diff options
author | Victor Stinner <vstinner@python.org> | 2023-09-04 09:21:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 09:21:47 (GMT) |
commit | 5a79d2ae572fed03eb9b9554b2760a34e75191a7 (patch) | |
tree | e84af8e19438eb37189ea0586a2e3e444551dd3f /Lib | |
parent | 44fc378b598eb675a847d1b7c46c8f6e81313c04 (diff) | |
download | cpython-5a79d2ae572fed03eb9b9554b2760a34e75191a7.zip cpython-5a79d2ae572fed03eb9b9554b2760a34e75191a7.tar.gz cpython-5a79d2ae572fed03eb9b9554b2760a34e75191a7.tar.bz2 |
Revert "gh-46376: Return existing pointer when possible in ctypes (#1… (#108688)
This reverts commit 08447b5deb47e2a0df87fa0a0576d300e5c909b4.
Revert also _ctypes.c changes of the PyDict_ContainsString() change,
commit 67266266469fe0e817736227f39537182534c1a5.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_ctypes/test_keeprefs.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/Lib/test/test_ctypes/test_keeprefs.py b/Lib/test/test_ctypes/test_keeprefs.py index c6fe1de..23b03b6 100644 --- a/Lib/test/test_ctypes/test_keeprefs.py +++ b/Lib/test/test_ctypes/test_keeprefs.py @@ -98,33 +98,6 @@ class PointerTestCase(unittest.TestCase): x = pointer(i) self.assertEqual(x._objects, {'1': i}) - def test_pp_ownership(self): - d = c_int(123) - n = c_int(456) - - p = pointer(d) - pp = pointer(p) - - self.assertIs(pp._objects['1'], p) - self.assertIs(pp._objects['0']['1'], d) - - pp.contents.contents = n - - self.assertIs(pp._objects['1'], p) - self.assertIs(pp._objects['0']['1'], n) - - self.assertIs(p._objects['1'], n) - self.assertEqual(len(p._objects), 1) - - del d - del p - - self.assertIs(pp._objects['0']['1'], n) - self.assertEqual(len(pp._objects), 2) - - del n - - self.assertEqual(len(pp._objects), 2) class PointerToStructure(unittest.TestCase): def test(self): |