[PATCH] extensions: don't fail to load on Windows if path ends with a '\' (issue4187)

Augie Fackler raf at durin42.com
Tue Mar 4 17:22:42 CST 2014


On Mar 4, 2014, at 6:17 PM, Ed Morley <emorley at mozilla.com> wrote:

> # HG changeset patch
> # User Ed Morley <emorley at mozilla.com>
> # Date 1393974750 0
> #      Tue Mar 04 23:12:30 2014 +0000
> # Node ID 74e8f96578fdad93d682f676441d1b04f1c34901
> # Parent  5beb49fd5958cd46cb933a8bccf482b56eb55b18
> extensions: don't fail to load on Windows if path ends with a '\' (issue4187)

Looks trivially correct, queued despite my lack of a windows test machine.

> 
> Same fix as 5c794e7331e7 but now works on Windows too.
> 
> diff -r 5beb49fd5958 -r 74e8f96578fd mercurial/extensions.py
> --- a/mercurial/extensions.py
> +++ b/mercurial/extensions.py
> @@ -46,7 +46,7 @@ def loadpath(path, module_name):
>     path = 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.rstrip(os.sep))
>         fd, fpath, desc = imp.find_module(f, [d])
>         return imp.load_module(module_name, fd, fpath, desc)
>     else:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20140304/30dc2d97/attachment.pgp>


More information about the Mercurial-devel mailing list