Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
gh-84436: Implement Immortal Objects#19474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
0c930b77005944c6a1bfa51e4879cc2ece372d12faf04776efa8d668f06663336e0a9a2f9fa29a1bc9810b12a161332f0317883d7bc23d4d825f8fa9a6f4f96899f5cd285010b7d2c21093edae54af788b29c8ff701579aa12da60a99a51715ad069874248a357a084937d4f6d3bcea6b439b7bea23b5a07fa8406ff9ab23d6f70966dc3e4385e075b0bb9957e264650c2bc92ce1319afbb1b1261f128ae6bf2e262ff2c708205203866ad765c7e30e530f0b3375cd6570aff4e49b58aef478b17225f3e0f6ad8e54c8fe2e274104c8292575949df42baee89f7da0f84bea515dfb5863f7287b25af016702cf9af25fd52abe8695538a14a9c828369ee41af6f835e6d8573af4ad19ff666c625f1379d501c9ee6d287b57cc736a7c60f07601321ff6a719b419f3ed398f72afe52d6d789fd8a983478467eb5da8cdef8da3fe6727e38df3ce73f6dcdd68efa118cff33168a85c9ada9fd5d3beb9ea342e3d78a56016d59e3f49c13c8262e5696c7caa3493c850f38657401a3c36bd2d949df144715f7365ea9f01cc39b6173ae8374ba7cfe17a2912388ede6734bdf3cab1f6e4c2c228e219ebdccd42e1699e7549d7df47300238eb9355ca2eedd412ccf8b61e57910d6437df7ba75726418b2ff1468f52e30fea45aa8c34d74a4c59be58d4f00f7f8747039d01017e16f0cf327997d57749680ec71c742bc28cb0c8b694f6abab4d1dfe27a766154159513a760329b5a5e29d5f88cbb67efa7608ebb3db2c3d2425684be74529e23cfb56b6a748e80033c86d520fbc390e0016bc726b05e0cd08f7fbf0192fbf961c390cc030016a093c4056c0fdba74b6e7b433d1e3069da16d22a4bfe04ef7e3b3b142ab3f9513e55a32ff69be7e6e459ce19f50a7c233b09b2b49c018be4cf4aa5b41d2ee06c6a14f247819f69423c61a4a9067181aedd0a1846867b1c57e82b165d85d9d39053b22a9caa2d56f1d81bae61959cb2c21File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,28 @@ | ||
| import sys | ||
| import types | ||
| # bpo-46417: Test that structseq types used by the sys module are still | ||
| # valid when Py_Finalize()/Py_Initialize() are called multiple times. | ||
eduardo-elizondo marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| class TestStructSeq: | ||
| # test PyTypeObject members | ||
| def_check_structseq(self, obj_type): | ||
| # ob_refcnt | ||
| assert(sys.getrefcount(obj_type) > 1) | ||
eduardo-elizondo marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| # tp_base | ||
| assert(issubclass(obj_type, tuple)) | ||
| # tp_bases | ||
| assert(obj_type.__bases__ == (tuple,)) | ||
| # tp_dict | ||
| assert(isinstance(obj_type.__dict__, types.MappingProxyType)) | ||
| # tp_mro | ||
| assert(obj_type.__mro__ == (obj_type, tuple, object)) | ||
| # tp_name | ||
| assert(isinstance(type.__name__, str)) | ||
| # tp_subclasses | ||
| assert(obj_type.__subclasses__() == []) | ||
| defsys_attrs(self): | ||
eduardo-elizondo marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| for attr_name in ( | ||
| 'flags', # FlagsType | ||
| 'float_info', # FloatInfoType | ||
| @@ -32,23 +31,23 @@ def test_sys_attrs(self): | ||
| 'thread_info', # ThreadInfoType | ||
| 'version_info', # VersionInfoType | ||
| ): | ||
| attr = getattr(sys, attr_name) | ||
| self._check_structseq(type(attr)) | ||
| defsys_funcs(self): | ||
| func_names = ['get_asyncgen_hooks'] # AsyncGenHooksType | ||
| if hasattr(sys, 'getwindowsversion'): | ||
| func_names.append('getwindowsversion') # WindowsVersionType | ||
| for func_name in func_names: | ||
| func = getattr(sys, func_name) | ||
| obj = func() | ||
| self._check_structseq(type(obj)) | ||
| try: | ||
| tests = TestStructSeq() | ||
| tests.sys_attrs() | ||
| tests.sys_funcs() | ||
| except SystemExit as exc: | ||
| if exc.args[0] != 0: | ||
| raise | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.