Mercurial > hg
changeset 20200:532fa12033e1
import-checker: use any() and a genexp to avoid awkward for/else construction
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 24 Dec 2013 19:10:04 -0500 |
parents | d87ed25733a1 |
children | bc3b48b0f5c8 |
files | contrib/import-checker.py |
diffstat | 1 files changed, 1 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/import-checker.py Sun Dec 22 21:27:00 2013 -0800 +++ b/contrib/import-checker.py Tue Dec 24 19:10:04 2013 -0500 @@ -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 stdlib_prefixes): continue if 'site-packages' in libpath: continue