diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-02 18:25:23 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-02 18:25:23 +0400 |
commit | d34876518114f1c03236349e2a4b5e356b6b9dc6 (patch) | |
tree | ea60c8225565ebc85602134ec8bbfb60cb87c19b /release | |
parent | bd0e14d90b30f1535d6909877dde8e6db529083a (diff) |
use try/except when unloading modules too.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 31acb3d7223..db89983744e 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -553,14 +553,24 @@ _register_immediate = True def _unload_module(module, free=True): for t in TypeMap.get(module, ()): - bpy_types.unregister(t) + try: + bpy_types.unregister(t) + except: + import traceback + print("bpy.utils._unload_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__)) + traceback.print_exc() if free == True and module in TypeMap: del TypeMap[module] for t in PropertiesMap.get(module, ()): - bpy_types.unregister(t) + try: + bpy_types.unregister(t) + except: + import traceback + print("bpy.utils._unload_module(): Module '%s' failed to unregister class '%s.%s'" % (module, t.__module__, t.__name__)) + traceback.print_exc() if free == True and module in PropertiesMap: del PropertiesMap[module] @@ -571,7 +581,7 @@ def _load_module(module, force=False): bpy_types.register(t) except: import traceback - print("bpy.utils._load_module(): Module '%s' failed to register calss '%s.%s'" % (module, t.__module__, t.__name__)) + print("bpy.utils._load_module(): Module '%s' failed to register class '%s.%s'" % (module, t.__module__, t.__name__)) traceback.print_exc() _bpy._load_module = _load_module |