summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-12-08 14:42:42 (GMT)
committerGitHub <noreply@github.com>2020-12-08 14:42:42 (GMT)
commit0f91f586ae9b76c3bb44559bd8cd473b1b8de5ff (patch)
tree9772c6ff798edc8333160b9d587b5a0a9691391a
parentb6d98c10fff6f320f8fdf595c3f9a05d8be4e31d (diff)
downloadcpython-0f91f586ae9b76c3bb44559bd8cd473b1b8de5ff.zip
cpython-0f91f586ae9b76c3bb44559bd8cd473b1b8de5ff.tar.gz
cpython-0f91f586ae9b76c3bb44559bd8cd473b1b8de5ff.tar.bz2
bpo-42599: Remove useless PyModule_GetWarningsModule() (GH-23691)
Removed PyModule_GetWarningsModule() which is useless due to the _warnings module was converted to a builtin module in 2.6.
-rw-r--r--Doc/whatsnew/3.10.rst5
-rw-r--r--Python/errors.c3
-rw-r--r--Python/pylifecycle.c8
3 files changed, 5 insertions, 11 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index a5cb4e3..23e28aa 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -480,6 +480,11 @@ Removed
into their code.
(Contributed by Dong-hee Na and Terry J. Reedy in :issue:`42299`.)
+* Removed the :c:func:`PyModule_GetWarningsModule` function that was useless
+ now due to the _warnings module was converted to a builtin module in 2.6.
+ (Contributed by Hai Shi in :issue:`42599`.)
+
+
Porting to Python 3.10
======================
diff --git a/Python/errors.c b/Python/errors.c
index 8242ac6..213108f 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -1534,9 +1534,6 @@ PyErr_WriteUnraisable(PyObject *obj)
}
-extern PyObject *PyModule_GetWarningsModule(void);
-
-
void
PyErr_SyntaxLocation(const char *filename, int lineno)
{
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 428c887..70824ff 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -97,14 +97,6 @@ _Py_IsFinalizing(void)
int (*_PyOS_mystrnicmp_hack)(const char *, const char *, Py_ssize_t) = \
PyOS_mystrnicmp; /* Python/pystrcmp.o */
-/* PyModule_GetWarningsModule is no longer necessary as of 2.6
-since _warnings is builtin. This API should not be used. */
-PyObject *
-PyModule_GetWarningsModule(void)
-{
- return PyImport_ImportModule("warnings");
-}
-
/* APIs to access the initialization flags
*