Changeset 10879:1707c807d6f4 in orange


Ignore:
Timestamp:
05/21/12 12:30:06 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Handle all exceptions when entry_points loading fails.

Location:
Orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngRegistry.py

    r10865 r10879  
    102102        except ImportError, err: 
    103103            print "While loading, importing widgets '%s' failed: %s" % (entry_point.name, err) 
     104        except pkg_resources.DistributionNotFound, err: 
     105            print "Loading add-on '%s' failed because of a missing dependency: '%s'" % (entry_point.name, err) 
     106        except Exception, err: 
     107            print "An exception occurred during the loading of '%s':\n%r" %(entry_point.name, err) 
    104108 
    105109    categories = {}      
  • Orange/__init__.py

    r10827 r10879  
    4343        except ImportError, err: 
    4444            warnings.warn("Importing add-on '%s' failed: %s" % (entry_point.name, err), UserWarning, 2) 
     45        except pkg_resources.DistributionNotFound, err: 
     46            warnings.warn("Loading add-on '%s' failed because of a missing dependency: '%s'" % (entry_point.name, err), UserWarning, 2) 
     47        except Exception, err: 
     48            warning.warn("An exception occurred during the loading of '%s':\n%r" %(entry_point.name, err), UserWarning, 2) 
     49 
    4550 
    4651_import("utils") 
Note: See TracChangeset for help on using the changeset viewer.