comparison contrib/import-checker.py @ 28713:806d260c6f3b

tests: fix builtin module test on pypy On pypy datetime and cProfile are modules written in Python, not in C. For the purpose of this test, just list them explicitely as builtins, which silences warnings about them being imported before stdlib modules.
author Maciej Fijalkowski <fijall@gmail.com>
date Wed, 30 Mar 2016 21:54:26 +0200
parents 1fa6fdb72275
children a94f34306bb9
comparison
equal deleted inserted replaced
28712:80e922479891 28713:806d260c6f3b
181 # consider them stdlib. 181 # consider them stdlib.
182 for m in ['msvcrt', '_winreg']: 182 for m in ['msvcrt', '_winreg']:
183 yield m 183 yield m
184 yield 'builtins' # python3 only 184 yield 'builtins' # python3 only
185 for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only 185 for m in 'fcntl', 'grp', 'pwd', 'termios': # Unix only
186 yield m
187 for m in 'cPickle', 'datetime': # in Python (not C) on PyPy
186 yield m 188 yield m
187 stdlib_prefixes = set([sys.prefix, sys.exec_prefix]) 189 stdlib_prefixes = set([sys.prefix, sys.exec_prefix])
188 # We need to supplement the list of prefixes for the search to work 190 # We need to supplement the list of prefixes for the search to work
189 # when run from within a virtualenv. 191 # when run from within a virtualenv.
190 for mod in (BaseHTTPServer, zlib): 192 for mod in (BaseHTTPServer, zlib):