[CMF-checkins] SVN: CMF/trunk/GenericSetup/utils.py Correctly fail with proper traceback on import errors inside imported files.

Florent Guillaume fg at nuxeo.com
Tue Dec 13 11:36:25 EST 2005


Log message for revision 40767:
  Correctly fail with proper traceback on import errors inside imported files.
  

Changed:
  U   CMF/trunk/GenericSetup/utils.py

-=-
Modified: CMF/trunk/GenericSetup/utils.py
===================================================================
--- CMF/trunk/GenericSetup/utils.py	2005-12-13 16:35:07 UTC (rev 40766)
+++ CMF/trunk/GenericSetup/utils.py	2005-12-13 16:36:25 UTC (rev 40767)
@@ -16,6 +16,7 @@
 """
 
 import os
+import sys
 from inspect import getdoc
 from xml.dom.minidom import _nssplit
 from xml.dom.minidom import Document
@@ -81,6 +82,8 @@
             break
 
         except ImportError:
+            # Reraise if the import error was caused inside the imported file
+            if sys.exc_info()[2].tb_next is not None: raise
 
             del parts_copy[ -1 ]
 



More information about the CMF-checkins mailing list