Lines Matching defs:sys
5 import sys
23 stderr_fd = sys.__stderr__.fileno()
45 support.record_original_stdout(sys.stdout)
48 # Prepend test directory to sys.path, so runtest() will be able
50 sys.path.insert(0, os.path.abspath(ns.testdir))
55 # These modules are searched first in sys.path[0] (so '' -- the CWD) and if
58 # not found in the CWD, and since the other paths in sys.path[1:] are absolute
62 for module in sys.modules.values():
82 if hasattr(sys, 'addaudithook'):
86 sys.addaudithook(_test_audit_hook)
117 stdout = sys.stdout
121 # On IDLE, sys.stdout has no file descriptor and is not a TextIOWrapper
122 # object. Leaving sys.stdout unchanged.
128 sys.stdout = open(fd, 'w',
135 sys.stdout.close()
136 sys.stdout = stdout