Lines Matching defs:sys
4 thus has no external changes made to import-related attributes in sys.
15 import sys
41 """sys.modules"""
47 sys.modules[name] = module
54 if name in sys.modules:
55 del sys.modules[name]
57 yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
63 sys.dont_write_bytecode = True
66 # Clears out sys.modules and puts an entry at the front of sys.path.
69 sys.meta_path.append(importlib.machinery.PathFinder)
72 sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
73 yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
76 sys.dont_write_bytecode = False
86 sys.dont_write_bytecode = True
88 yield from bench(name, lambda: sys.modules.pop(name),
91 sys.dont_write_bytecode = False
102 assert not sys.dont_write_bytecode
105 sys.meta_path.append(importlib.machinery.PathFinder)
108 sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
110 sys.modules.pop(name)
121 assert not sys.dont_write_bytecode
123 sys.modules.pop(name)
139 sys.meta_path.append(importlib.machinery.PathFinder)
142 sys.path_hooks.append(importlib.machinery.FileFinder.path_hook(loader))
145 yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
154 yield from bench(name, lambda: sys.modules.pop(name), repeat=repeat,
187 file=sys.stderr)
188 sys.exit(1)
200 sys.stdout.flush()
205 sys.stdout.flush()
206 assert not sys.dont_write_bytecode