Submitter | Chris Jerdonek |
---|---|
Date | Dec. 25, 2013, 12:08 a.m. |
Message ID | <CAOTb1wfawKYj27b7V2O12QiwQNmocz0U7Yko4ntg36bjjEC=KQ@mail.gmail.com> |
Download | mbox | patch |
Permalink | /patch/3236/ |
State | Accepted |
Headers | show |
Comments
On Dec 24, 2013, at 7:08 PM, Chris Jerdonek <chris.jerdonek@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.
Patch
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.