mercurial/extensions.py
changeset 4582 7de7a80e7422
parent 4578 b1716a8b32d3
parent 4581 3daed3680554
child 4618 669e76b7df24
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -17,8 +17,8 @@ def find(name):
         return _extensions[name]
     except KeyError:
         for k, v in _extensions.iteritems():
-            if k.endswith('.' + name) or k.endswith('/' + name) or v == name:
-                return sys.modules[v]
+            if k.endswith('.' + name) or k.endswith('/' + name):
+                return v
         raise KeyError(name)
 
 def load(ui, name, path):