mercurial/extensions.py
changeset 14415 c238b12a1ed4
parent 14318 1f46be4689ed
child 14530 cd31a1cc1521
--- a/mercurial/extensions.py	Mon May 23 15:56:31 2011 +0200
+++ b/mercurial/extensions.py	Mon May 23 23:09:00 2011 +0300
@@ -21,13 +21,17 @@
 
 def find(name):
     '''return module with given extension name'''
+    mod = None
     try:
-        return _extensions[name]
+        mod =  _extensions[name]
     except KeyError:
         for k, v in _extensions.iteritems():
             if k.endswith('.' + name) or k.endswith('/' + name):
-                return v
+                mod = v
+                break
+    if not mod:
         raise KeyError(name)
+    return mod
 
 def loadpath(path, module_name):
     module_name = module_name.replace('.', '_')