comparison contrib/import-checker.py @ 29395:4c8026babe8c

import-checker: ensure cffi is always a system module I've had reports that this is not always happening, so whitelist it the way we whitelist other problem cases.
author Augie Fackler <raf@durin42.com>
date Thu, 23 Jun 2016 20:45:37 -0400
parents 7712fcde2d56
children 74eecb93c617
comparison
equal deleted inserted replaced
29394:6d96658a22b0 29395:4c8026babe8c
184 >>> 'collections' in mods 184 >>> 'collections' in mods
185 True 185 True
186 186
187 >>> 'cStringIO' in mods 187 >>> 'cStringIO' in mods
188 True 188 True
189
190 >>> 'cffi' in mods
191 True
189 """ 192 """
190 for m in sys.builtin_module_names: 193 for m in sys.builtin_module_names:
191 yield m 194 yield m
192 # These modules only exist on windows, but we should always 195 # These modules only exist on windows, but we should always
193 # consider them stdlib. 196 # consider them stdlib.
195 yield m 198 yield m
196 yield 'builtins' # python3 only 199 yield 'builtins' # python3 only
197 for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only 200 for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only
198 yield m 201 yield m
199 for m in 'cPickle', 'datetime': # in Python (not C) on PyPy 202 for m in 'cPickle', 'datetime': # in Python (not C) on PyPy
203 yield m
204 for m in ['cffi']:
200 yield m 205 yield m
201 stdlib_prefixes = set([sys.prefix, sys.exec_prefix]) 206 stdlib_prefixes = set([sys.prefix, sys.exec_prefix])
202 # We need to supplement the list of prefixes for the search to work 207 # We need to supplement the list of prefixes for the search to work
203 # when run from within a virtualenv. 208 # when run from within a virtualenv.
204 for mod in (BaseHTTPServer, zlib): 209 for mod in (BaseHTTPServer, zlib):