changeset 20645:7d83c3b6e8d9

extensions: use normpath to allow trailing '\' on Windows (issue4187) Fixes same issue as 5c794e7331e7 but now works on Windows too. With this patch a trailing backward slash won't prevent the extension from being found on Windows, and we continue to support any combination of forward and back slashes within the path.
author Ed Morley <emorley@mozilla.com>
date Wed, 05 Mar 2014 09:31:05 +0000
parents 779ceb84f4f7
children a4d587c6e3dd
files mercurial/extensions.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Tue Mar 04 09:56:59 2014 -0600
+++ b/mercurial/extensions.py	Wed Mar 05 09:31:05 2014 +0000
@@ -43,10 +43,10 @@
 
 def loadpath(path, module_name):
     module_name = module_name.replace('.', '_')
-    path = util.expandpath(path)
+    path = util.normpath(util.expandpath(path))
     if os.path.isdir(path):
         # module/__init__.py style
-        d, f = os.path.split(path.rstrip('/'))
+        d, f = os.path.split(path)
         fd, fpath, desc = imp.find_module(f, [d])
         return imp.load_module(module_name, fd, fpath, desc)
     else: