diff --git a/PKG-INFO b/PKG-INFO index 6fe9ed1..03fa1de 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: zombie-imp -Version: 0.0.2 +Version: 0.0.3 Summary: A copy of the `imp` module that was removed in Python 3.12 Maintainer-email: Petr Viktorin Project-URL: Homepage, https://github.com/encukou/zombie-imp @@ -14,7 +14,7 @@ License-File: LICENSE # zombie-imp -~~A particularly mischevious act of necromancy. That is,~~ +~~A particularly mischievous act of necromancy. That is,~~ A copy of the `imp` module that was removed in Python 3.12. Don't use this, it'll probably trick and bite you. diff --git a/README.md b/README.md index 4ff1ebf..1e0b91d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # zombie-imp -~~A particularly mischevious act of necromancy. That is,~~ +~~A particularly mischievous act of necromancy. That is,~~ A copy of the `imp` module that was removed in Python 3.12. Don't use this, it'll probably trick and bite you. diff --git a/debian/changelog b/debian/changelog index e6e8885..49aefcf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +python-zombie-imp (0.0.3-1) unstable; urgency=medium + + * New upstream release. + * Update copyright years + * Update watch file (Closes: #1101042) + * Drop upstream patch + + -- Gianfranco Costamagna Sun, 23 Mar 2025 18:59:17 +0100 + +python-zombie-imp (0.0.2-3) unstable; urgency=medium + + * Add python3-setuptools B-D (Closes: #1080780) + * Bump std-version to 4.7.0 + + -- Gianfranco Costamagna Fri, 14 Mar 2025 11:23:16 +0100 + python-zombie-imp (0.0.2-2) unstable; urgency=medium * No change reupload for testing migration diff --git a/debian/control b/debian/control index 224c879..f96b3c9 100644 --- a/debian/control +++ b/debian/control @@ -3,8 +3,8 @@ Section: python Priority: optional Maintainer: Gianfranco Costamagna Build-Depends: debhelper-compat (= 13), dh-python, - python3-all, pybuild-plugin-pyproject -Standards-Version: 4.6.2 + python3-all, pybuild-plugin-pyproject, python3-setuptools +Standards-Version: 4.7.0 Package: python3-zombie-imp Architecture: all @@ -14,7 +14,7 @@ Suggests: ${python3:Suggests} Description: copy of the `imp` module that was removed in Python 3.12 # zombie-imp . - ~~A particularly mischevious act of necromancy. That is,~~ + ~~A particularly mischievous act of necromancy. That is,~~ A copy of the `imp` module that was removed in Python 3.12. . Don't use this, it'll probably trick and bite you. diff --git a/debian/copyright b/debian/copyright index a8df7cb..0f257bf 100644 --- a/debian/copyright +++ b/debian/copyright @@ -8,7 +8,7 @@ Copyright: (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam License: Python-license Files: debian/* -Copyright: 2023 Gianfranco Costamagna +Copyright: 2023-2025 Gianfranco Costamagna License: Python-license License: Python-license diff --git a/debian/patches/d45295faf4.patch b/debian/patches/d45295faf4.patch deleted file mode 100644 index 46cafbc..0000000 --- a/debian/patches/d45295faf4.patch +++ /dev/null @@ -1,99 +0,0 @@ -From d45295faf41b204e0d684fc54b8a5bbe2cee2086 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Tue, 24 Oct 2023 14:36:04 +0200 -Subject: [PATCH] Make the tests pass with Python 3.13.0a1 - ---- - test_zombie_imp/badsyntax_pep3120.py | 1 + - test_zombie_imp/test_imp.py | 8 +++----- - test_zombie_imp/test_zombie_imp.py | 8 +++----- - 3 files changed, 7 insertions(+), 10 deletions(-) - create mode 100644 test_zombie_imp/badsyntax_pep3120.py - -diff --git a/test_zombie_imp/badsyntax_pep3120.py b/test_zombie_imp/badsyntax_pep3120.py -new file mode 100644 -index 0000000..d14b4c9 ---- /dev/null -+++ b/test_zombie_imp/badsyntax_pep3120.py -@@ -0,0 +1 @@ -+print("böse") -diff --git a/test_zombie_imp/test_imp.py b/test_zombie_imp/test_imp.py -index a9f2e29..60c1f0c 100644 ---- a/test_zombie_imp/test_imp.py -+++ b/test_zombie_imp/test_imp.py -@@ -25,8 +25,6 @@ - import imp #!! this should be the only difference between test_imp and test_zombie_imp! - import _imp - --orig__file__ = os.path.join(test.__path__[0], os.path.split(__file__)[-1]) -- - - OS_PATH_NAME = os.path.__name__ - -@@ -86,7 +84,7 @@ def test_find_module_encoding(self): - with imp.find_module('module_' + mod, self.test_path)[0] as fd: - self.assertEqual(fd.encoding, encoding) - -- path = [os.path.dirname(orig__file__)] -+ path = [os.path.dirname(__file__)] - with self.assertRaises(SyntaxError): - imp.find_module('badsyntax_pep3120', path) - -@@ -211,7 +209,7 @@ def test_issue5604(self): - os_helper.rmtree('__pycache__') - - def test_issue9319(self): -- path = os.path.dirname(orig__file__) -+ path = os.path.dirname(__file__) - self.assertRaises(SyntaxError, - imp.find_module, "badsyntax_pep3120", [path]) - -@@ -333,7 +331,7 @@ def test_load_source(self): - mod = type(sys.modules[__name__])(modname) - with support.swap_item(sys.modules, modname, mod): - with self.assertRaisesRegex(ValueError, 'embedded null'): -- imp.load_source(modname, orig__file__ + "\0") -+ imp.load_source(modname, __file__ + "\0") - - @support.cpython_only - def test_issue31315(self): -diff --git a/test_zombie_imp/test_zombie_imp.py b/test_zombie_imp/test_zombie_imp.py -index cb21869..3ce25b8 100644 ---- a/test_zombie_imp/test_zombie_imp.py -+++ b/test_zombie_imp/test_zombie_imp.py -@@ -25,8 +25,6 @@ - import zombie_imp as imp #!! this should be the only difference between test_imp and test_zombie_imp - import _imp - --orig__file__ = os.path.join(test.__path__[0], os.path.split(__file__)[-1]) -- - - OS_PATH_NAME = os.path.__name__ - -@@ -86,7 +84,7 @@ def test_find_module_encoding(self): - with imp.find_module('module_' + mod, self.test_path)[0] as fd: - self.assertEqual(fd.encoding, encoding) - -- path = [os.path.dirname(orig__file__)] -+ path = [os.path.dirname(__file__)] - with self.assertRaises(SyntaxError): - imp.find_module('badsyntax_pep3120', path) - -@@ -211,7 +209,7 @@ def test_issue5604(self): - os_helper.rmtree('__pycache__') - - def test_issue9319(self): -- path = os.path.dirname(orig__file__) -+ path = os.path.dirname(__file__) - self.assertRaises(SyntaxError, - imp.find_module, "badsyntax_pep3120", [path]) - -@@ -333,7 +331,7 @@ def test_load_source(self): - mod = type(sys.modules[__name__])(modname) - with support.swap_item(sys.modules, modname, mod): - with self.assertRaisesRegex(ValueError, 'embedded null'): -- imp.load_source(modname, orig__file__ + "\0") -+ imp.load_source(modname, __file__ + "\0") - - @support.cpython_only - def test_issue31315(self): diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index ed1604f..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -d45295faf4.patch diff --git a/debian/watch b/debian/watch index 98832d7..dacc68a 100644 --- a/debian/watch +++ b/debian/watch @@ -1,4 +1,4 @@ # try also https://pypi.debian.net/zombie-imp/watch version=4 opts=uversionmangle=s/(rc|a|b|c)/~$1/ \ -https://pypi.debian.net/zombie-imp/zombie-imp-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) +https://pypi.debian.net/zombie-imp/zombie_imp-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) diff --git a/imp.py b/imp.py index ca2ee0b..27855cc 100644 --- a/imp.py +++ b/imp.py @@ -4,5 +4,5 @@ from zombie_imp.imp_3_11 import _frozen_module_names except ImportError: pass -from zombie_imp.imp_3_11 import _ERR_MSG, _exec, _load, _builtin_from_name +from zombie_imp.imp_3_11 import _ERR_MSG_PREFIX, _exec, _load, _builtin_from_name from zombie_imp.imp_3_11 import _HackedGetData, _LoadSourceCompatibility, _LoadCompiledCompatibility diff --git a/pyproject.toml b/pyproject.toml index 6b960f4..aef26eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "zombie-imp" -version = "0.0.2" +version = "0.0.3" maintainers = [ { name="Petr Viktorin", email="encukou@gmail.com" }, ] diff --git a/test_zombie_imp/badsyntax_pep3120.py b/test_zombie_imp/badsyntax_pep3120.py new file mode 100644 index 0000000..d14b4c9 --- /dev/null +++ b/test_zombie_imp/badsyntax_pep3120.py @@ -0,0 +1 @@ +print("böse") diff --git a/test_zombie_imp/test_imp.py b/test_zombie_imp/test_imp.py index a9f2e29..60c1f0c 100644 --- a/test_zombie_imp/test_imp.py +++ b/test_zombie_imp/test_imp.py @@ -25,8 +25,6 @@ import imp #!! this should be the only difference between test_imp and test_zombie_imp! import _imp -orig__file__ = os.path.join(test.__path__[0], os.path.split(__file__)[-1]) - OS_PATH_NAME = os.path.__name__ @@ -86,7 +84,7 @@ def test_find_module_encoding(self): with imp.find_module('module_' + mod, self.test_path)[0] as fd: self.assertEqual(fd.encoding, encoding) - path = [os.path.dirname(orig__file__)] + path = [os.path.dirname(__file__)] with self.assertRaises(SyntaxError): imp.find_module('badsyntax_pep3120', path) @@ -211,7 +209,7 @@ def test_issue5604(self): os_helper.rmtree('__pycache__') def test_issue9319(self): - path = os.path.dirname(orig__file__) + path = os.path.dirname(__file__) self.assertRaises(SyntaxError, imp.find_module, "badsyntax_pep3120", [path]) @@ -333,7 +331,7 @@ def test_load_source(self): mod = type(sys.modules[__name__])(modname) with support.swap_item(sys.modules, modname, mod): with self.assertRaisesRegex(ValueError, 'embedded null'): - imp.load_source(modname, orig__file__ + "\0") + imp.load_source(modname, __file__ + "\0") @support.cpython_only def test_issue31315(self): diff --git a/test_zombie_imp/test_zombie_imp.py b/test_zombie_imp/test_zombie_imp.py index cb21869..3ce25b8 100644 --- a/test_zombie_imp/test_zombie_imp.py +++ b/test_zombie_imp/test_zombie_imp.py @@ -25,8 +25,6 @@ import zombie_imp as imp #!! this should be the only difference between test_imp and test_zombie_imp import _imp -orig__file__ = os.path.join(test.__path__[0], os.path.split(__file__)[-1]) - OS_PATH_NAME = os.path.__name__ @@ -86,7 +84,7 @@ def test_find_module_encoding(self): with imp.find_module('module_' + mod, self.test_path)[0] as fd: self.assertEqual(fd.encoding, encoding) - path = [os.path.dirname(orig__file__)] + path = [os.path.dirname(__file__)] with self.assertRaises(SyntaxError): imp.find_module('badsyntax_pep3120', path) @@ -211,7 +209,7 @@ def test_issue5604(self): os_helper.rmtree('__pycache__') def test_issue9319(self): - path = os.path.dirname(orig__file__) + path = os.path.dirname(__file__) self.assertRaises(SyntaxError, imp.find_module, "badsyntax_pep3120", [path]) @@ -333,7 +331,7 @@ def test_load_source(self): mod = type(sys.modules[__name__])(modname) with support.swap_item(sys.modules, modname, mod): with self.assertRaisesRegex(ValueError, 'embedded null'): - imp.load_source(modname, orig__file__ + "\0") + imp.load_source(modname, __file__ + "\0") @support.cpython_only def test_issue31315(self): diff --git a/tox.ini b/tox.ini index 739cbfc..50c3757 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,8 @@ env_list = py310 py311 py312 + py313 + py314 [testenv] commands = python -m unittest discover -v test_zombie_imp/ diff --git a/zombie_imp.egg-info/PKG-INFO b/zombie_imp.egg-info/PKG-INFO index 6fe9ed1..03fa1de 100644 --- a/zombie_imp.egg-info/PKG-INFO +++ b/zombie_imp.egg-info/PKG-INFO @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: zombie-imp -Version: 0.0.2 +Version: 0.0.3 Summary: A copy of the `imp` module that was removed in Python 3.12 Maintainer-email: Petr Viktorin Project-URL: Homepage, https://github.com/encukou/zombie-imp @@ -14,7 +14,7 @@ License-File: LICENSE # zombie-imp -~~A particularly mischevious act of necromancy. That is,~~ +~~A particularly mischievous act of necromancy. That is,~~ A copy of the `imp` module that was removed in Python 3.12. Don't use this, it'll probably trick and bite you. diff --git a/zombie_imp.egg-info/SOURCES.txt b/zombie_imp.egg-info/SOURCES.txt index ee7b2f4..4b37f98 100644 --- a/zombie_imp.egg-info/SOURCES.txt +++ b/zombie_imp.egg-info/SOURCES.txt @@ -4,6 +4,7 @@ README.md imp.py pyproject.toml tox.ini +test_zombie_imp/badsyntax_pep3120.py test_zombie_imp/test_imp.py test_zombie_imp/test_pkgutil_reanimations.py test_zombie_imp/test_same_files.py diff --git a/zombie_imp/__init__.py b/zombie_imp/__init__.py index 183f079..8af0597 100644 --- a/zombie_imp/__init__.py +++ b/zombie_imp/__init__.py @@ -4,5 +4,5 @@ from .imp_3_11 import _frozen_module_names except ImportError: pass -from .imp_3_11 import _ERR_MSG, _exec, _load, _builtin_from_name +from .imp_3_11 import _ERR_MSG_PREFIX, _exec, _load, _builtin_from_name from .imp_3_11 import _HackedGetData, _LoadSourceCompatibility, _LoadCompiledCompatibility diff --git a/zombie_imp/imp_3_11.py b/zombie_imp/imp_3_11.py index 7bc707e..9f2da01 100644 --- a/zombie_imp/imp_3_11.py +++ b/zombie_imp/imp_3_11.py @@ -20,7 +20,7 @@ # Platform doesn't support dynamic loading. create_dynamic = None -from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name +from importlib._bootstrap import _ERR_MSG_PREFIX, _exec, _load, _builtin_from_name from importlib._bootstrap_external import SourcelessFileLoader from importlib import machinery @@ -297,7 +297,7 @@ def find_module(name, path=None): continue break # Break out of outer loop when breaking out of inner loop. else: - raise ImportError(_ERR_MSG.format(name), name=name) + raise ImportError(_ERR_MSG_PREFIX + repr(name), name=name) encoding = None if 'b' not in mode: