Skip to content

Commit

Permalink
gh-117142: Port _ctypes to multi-phase init (GH-117181)
Browse files Browse the repository at this point in the history
  • Loading branch information
neonene authored Apr 10, 2024
1 parent 4bb7d12 commit ef41182
Show file tree
Hide file tree
Showing 10 changed files with 1,125 additions and 178 deletions.
14 changes: 14 additions & 0 deletions Lib/test/test_ctypes/test_refcounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
from test import support
from test.support import import_helper
from test.support import script_helper
_ctypes_test = import_helper.import_module("_ctypes_test")


Expand Down Expand Up @@ -110,5 +111,18 @@ def func():
func()


class ModuleIsolationTest(unittest.TestCase):
def test_finalize(self):
# check if gc_decref() succeeds
script = (
"import ctypes;"
"import sys;"
"del sys.modules['_ctypes'];"
"import _ctypes;"
"exit()"
)
script_helper.assert_python_ok("-c", script)


if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Convert :mod:`!_ctypes` to multi-phase initialisation (:pep:`489`).
Loading

0 comments on commit ef41182

Please sign in to comment.