Changeset 10893:56092f83c966 in orange


Ignore:
Timestamp:
05/26/12 10:41:29 (23 months ago)
Author:
mitar
Branch:
default
Message:

Nicer add-on loading error message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/__init__.py

    r10892 r10893  
    4848            else: 
    4949                path, mod = name.rsplit('.', 1) 
    50                 parent_module = sys.modules['Orange.%s' % (path,)] 
     50                parent_module_name = 'Orange.%s' % (path,) 
     51                try: 
     52                    parent_module = sys.modules[parent_module_name] 
     53                except KeyError: 
     54                    warnings.warn("Loading add-on '%s' failed because destination namespace point '%s' was not found." % (entry_point.name, parent_module_name), UserWarning, 2) 
     55                    continue 
    5156                setattr(parent_module, mod, module) 
    5257            sys.modules['Orange.%s' % (name,)] = module 
Note: See TracChangeset for help on using the changeset viewer.