Commits

Rune Halvorsen committed 488e0e1

Tiny cleanup in exception handlign

  • Participants
  • Parent commits 2f1512b

Comments (0)

Files changed (1)

     def _attempt_load(self, modname):
         """Attempt to load module name modname, returning it on success,
         throwing ImportError if module couldn't be imported"""
-        try:
-            __import__(modname)
-        except ImportError:
-            return
-        else:
-            return sys.modules[modname]
+        __import__(modname)
+        return sys.modules[modname]
 
     def serialize(self, data):
         """Serialize the datastructure to json. Returns a string. Raises
 for modspec in _modules:
     try:
         implementation = _JsonImplementation(modspec)
+        break
     except ImportError:
         pass
 else: