Proper traceback when addons fails AST parsing setp
authorMartin Poirier <theeth@yahoo.com>
Sun, 27 Mar 2011 20:52:50 +0000 (20:52 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sun, 27 Mar 2011 20:52:50 +0000 (20:52 +0000)
release/scripts/modules/addon_utils.py

index d2001087f13046b2bea2a9a11236f5716d97bc1f..62a9f691acff647b1aa8cb5aa7591ca23075b356 100644 (file)
@@ -97,10 +97,17 @@ def modules(module_cache):
                             break
 
         if body_info:
-            mod = ModuleType(mod_name)
-            mod.bl_info = ast.literal_eval(body.value)
-            mod.__file__ = mod_path
-            mod.__time__ = os.path.getmtime(mod_path)
+            try:
+                mod = ModuleType(mod_name)
+                mod.bl_info = ast.literal_eval(body.value)
+                mod.__file__ = mod_path
+                mod.__time__ = os.path.getmtime(mod_path)
+            except:
+                print("AST error in module %s" % mod_name)
+                import traceback
+                traceback.print_exc()
+                raise
+            
             return mod
         else:
             return None