summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-10-05 22:00:45 (GMT)
committerGitHub <noreply@github.com>2022-10-05 22:00:45 (GMT)
commitc206e53bb726fa795d10cfb0e8d1d1a1a5d1aaa7 (patch)
tree137f9ccf92283c7d33da6f7cf2b614ebcb9ea2c1 /Python
parent2016bc54a22b83d0ca9174b64257cc7bb67a0916 (diff)
downloadcpython-c206e53bb726fa795d10cfb0e8d1d1a1a5d1aaa7.zip
cpython-c206e53bb726fa795d10cfb0e8d1d1a1a5d1aaa7.tar.gz
cpython-c206e53bb726fa795d10cfb0e8d1d1a1a5d1aaa7.tar.bz2
gh-65961: Raise `DeprecationWarning` when `__package__` differs from `__spec__.parent` (#97879)
Also remove `importlib.util.set_package()` which was already slated for removal. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 54c21fa..698ef37 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1573,7 +1573,7 @@ resolve_name(PyThreadState *tstate, PyObject *name, PyObject *globals, int level
goto error;
}
else if (equal == 0) {
- if (PyErr_WarnEx(PyExc_ImportWarning,
+ if (PyErr_WarnEx(PyExc_DeprecationWarning,
"__package__ != __spec__.parent", 1) < 0) {
goto error;
}