| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@serhiy-storchaka: In Python 3.13, non-string names lead to crashes. I had to remove these tests: diff --git a/Lib/test/test_capi/test_import.py b/Lib/test/test_capi/test_import.py
index 94f96728d91..3abd1cd7470 100644
--- a/Lib/test/test_capi/test_import.py
+++ b/Lib/test/test_capi/test_import.py
@@ -70,8 +70,6 @@ def check_addmodule(self, add_module, accept_nonstr=False):
names = ['nonexistent']
if accept_nonstr:
names.append(b'\xff') # non-UTF-8
- # PyImport_AddModuleObject() accepts non-string names
- names.append(tuple(['hashable non-string']))
for name in names:
with self.subTest(name=name):
self.assertNotIn(name, sys.modules)
@@ -311,9 +309,6 @@ def test_executecodemoduleobject(self):
code = compile('attr = 1', '<test>', 'exec')
self.assertRaises(TypeError, execute_code_func, [], code, NULL, NULL)
- nonstring = tuple(['hashable non-string'])
- self.assertRaises(AttributeError, execute_code_func, nonstring, code, NULL, NULL)
- sys.modules.pop(nonstring, None)
# CRASHES execute_code_func(NULL, code, NULL, NULL)
# CRASHES execute_code_func(name, NULL, NULL, NULL)
|
Sorry, something went wrong.
* Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit d95ba9f)
|
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
|
Sorry, @vstinner, I could not cleanly backport this to 3.12 due to a conflict. cherry_picker 34ded1a1a10204635cad27830fcbee2f8547e8ed 3.12 |
Sorry, something went wrong.
|
The change cannot be backported to 3.12: Modules/_testlimitedcapi.c doesn't exist in the 3.12 branch. |
Sorry, something went wrong.
…nGH-128915) (pythonGH-128960) pythongh-128911: Add tests on the PyImport C API (pythonGH-128915) * Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. (cherry picked from commit 34ded1a) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit d95ba9f)
|
GH-128989 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
) (#128989) * Add Modules/_testlimitedcapi/import.c * Add Lib/test/test_capi/test_import.py * Remove _testcapi.check_pyimport_addmodule(): tests already covered by newly added tests. (cherry picked from commit 34ded1a) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> (cherry picked from commit d95ba9f)
| Back | FazBrowse Home | New Git URL |
Co-authored-by: Serhiy Storchaka storchaka@gmail.com
(cherry picked from commit d95ba9f)