From b1d5fde69de3855d95953d8a046c3105df1413bd Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 12 Aug 2009 20:58:56 +0200 Subject: [PATCH] Catch more exceptions at top level. Previously, a bunch of intialization code was outside of the try, so any exceptions there would not be shown at all. --- src/main.py | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/main.py b/src/main.py index 85065dd..c278d4e 100644 --- a/src/main.py +++ b/src/main.py @@ -7,33 +7,34 @@ #tr.go() def run(): - import sys - import e32 - if e32.in_emulator(): - sys.path.append('c:/python/') + try: + import sys + import e32 + if e32.in_emulator(): + sys.path.append('c:/python/') + + + import os.path + print sys.path + # print os.path.dirname(__file__) + # sys.path.append(os.path.dirname(__file__)) + import log.logging + from log.logging import logger + import sys,os + logger.log_stderr() + sys.stderr.write('stderr logged from default') - import os.path - print sys.path -# print os.path.dirname(__file__) -# sys.path.append(os.path.dirname(__file__)) - import log.logging - from log.logging import logger - import sys,os - logger.log_stderr() - sys.stderr.write('stderr logged from default') - - - - lock=None - - from config.config import gtd_directory,read_configurations - read_configurations() + + lock=None + + from config.config import gtd_directory,read_configurations + read_configurations() - from inout.io import safe_chdir - safe_chdir(gtd_directory) - print os.getcwd() - try: + from inout.io import safe_chdir + safe_chdir(gtd_directory) + print os.getcwd() + e32.ao_yield() import sys,os -- 2.30.2