[pywin32-checkins] pywin32/Pythonwin/pywin/framework scriptutils.py, 1.13, 1.14
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-02-19 01:19:26
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7819 Modified Files: scriptutils.py Log Message: When attempting to import module, catch error if filename itself causes a syntax error Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** scriptutils.py 2 Aug 2002 06:51:24 -0000 1.13 --- scriptutils.py 19 Feb 2008 01:19:30 -0000 1.14 *************** *** 401,408 **** --- 401,413 ---- win32ui.DoWaitCursor(1) # win32ui.GetMainFrame().BeginWaitCursor() + try: # always do an import, as it is cheap is already loaded. This ensures # it is in our name space. codeObj = compile('import '+modName,'<auto import>','exec') + except SyntaxError: + win32ui.SetStatusText('Invalid filename for import: "' +modName+'"') + return + try: exec codeObj in __main__.__dict__ if bNeedReload: |