From 6c9bbc25da9adbccff4d4f887f2a7c0c4b1414f4 Mon Sep 17 00:00:00 2001 From: Xon Date: Fri, 25 Mar 2011 21:42:18 +0800 Subject: [PATCH] Better error messages, removed import which triggered a failure --- overviewer.py | 2 -- src/iterate.c | 13 +++++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/overviewer.py b/overviewer.py index ffaed15..ffc3882 100755 --- a/overviewer.py +++ b/overviewer.py @@ -32,8 +32,6 @@ import util logging.basicConfig(level=logging.INFO,format="%(asctime)s [%(levelname)s] %(message)s") -#import this before to ensure it doesn't have an errors or c_overviewer will eat them -import chunk # make sure the c_overviewer extension is available try: import c_overviewer diff --git a/src/iterate.c b/src/iterate.c index 1dcce1a..f535f39 100644 --- a/src/iterate.c +++ b/src/iterate.c @@ -32,11 +32,16 @@ int init_chunk_render(void) { if (blockmap) return 1; textures = PyImport_ImportModule("textures"); - chunk_mod = PyImport_ImportModule("chunk"); - /* ensure none of these pointers are NULL */ - if ((!textures) || (!chunk_mod)) { - fprintf(stderr, "\ninit_chunk_render failed\n"); + if ((!textures)) { + fprintf(stderr, "\ninit_chunk_render failed to load; textures\n"); + return 1; + } + + chunk_mod = PyImport_ImportModule("chunk"); + /* ensure none of these pointers are NULL */ + if ((!chunk_mod)) { + fprintf(stderr, "\ninit_chunk_render failed to load; chunk\n"); return 1; }