Lines Matching defs:sys
13 import sys
40 Py_DEBUG = hasattr(sys, 'gettotalrefcount')
72 p = subprocess.Popen([sys.executable, "-c",
97 orig_sys_exception = sys.exception()
99 new_sys_exception = sys.exception()
101 reset_sys_exception = sys.exception()
120 orig_sys_exc_info = sys.exc_info()
122 new_sys_exc_info = sys.exc_info()
124 reset_sys_exc_info = sys.exc_info()
176 return sys.maxsize
604 type_refcnt = sys.getrefcount(HeapGcCTypeSubclass)
612 self.assertEqual(type_refcnt - 1, sys.getrefcount(HeapGcCTypeSubclass))
626 A.refcnt_in_del = sys.getrefcount(A)
627 B.refcnt_in_del = sys.getrefcount(B)
630 type_refcnt = sys.getrefcount(B)
631 new_type_refcnt = sys.getrefcount(A)
649 self.assertEqual(type_refcnt - 1, sys.getrefcount(B))
652 self.assertEqual(new_type_refcnt, sys.getrefcount(A))
687 type_refcnt = sys.getrefcount(_testcapi.HeapCTypeSubclass)
695 self.assertEqual(type_refcnt - 1, sys.getrefcount(_testcapi.HeapCTypeSubclass))
699 type_refcnt = sys.getrefcount(_testcapi.HeapCTypeSubclassWithFinalizer)
700 new_type_refcnt = sys.getrefcount(_testcapi.HeapCTypeSubclass)
719 self.assertEqual(type_refcnt - 1, sys.getrefcount(_testcapi.HeapCTypeSubclassWithFinalizer))
722 self.assertEqual(new_type_refcnt, sys.getrefcount(_testcapi.HeapCTypeSubclass))
791 not_expected = ('sys',)
792 code = 'import _testcapi, sys; _testcapi.fatal_error(b"MESSAGE")'
795 # Mark _testcapi as stdlib module, but not sys
796 expected = ('sys',)
799 import _testcapi, sys
800 sys.stdlib_module_names = frozenset({"_testcapi"})
1001 import sys, builtins, pickle
1003 pickle.dump(id(sys.modules), f)
1009 self.assertNotEqual(pickle.load(f), id(sys.modules))
1131 self.assertEqual(_testcapi.Py_Version, sys.hexversion)
1213 import gc, os, sys, _testcapi
1349 return sys._getframe()
1352 yield sys._getframe()