[PATCH 1 of 3] import-checker: refactor sys.path prefix check (issue4129)
Augie Fackler
raf at durin42.com
Tue Dec 24 18:09:54 CST 2013
On Dec 24, 2013, at 7:08 PM, Chris Jerdonek <chris.jerdonek at gmail.com> wrote:
> diff --git a/contrib/import-checker.py b/contrib/import-checker.py
> --- a/contrib/import-checker.py
> +++ b/contrib/import-checker.py
> @@ -73,10 +73,7 @@
> for libpath in sys.path:
> # We want to walk everything in sys.path that starts with something
> # in stdlib_prefixes.
> - for prefix in stdlib_prefixes:
> - if libpath.startswith(prefix):
> - break
> - else:
> + if not any(libpath.startswith(p) for p in prefix):
>
> Oh, you want this to be "for p in stdlib_prefixes" though.
Derp. Thanks, I'll push a fixed version of my change.
-------------- 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/20131224/663f4f7f/attachment.pgp>
More information about the Mercurial-devel
mailing list