summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-02-15 13:07:59 (GMT)
committerGitHub <noreply@github.com>2023-02-15 13:07:59 (GMT)
commiteb0c485b6c836abb71932537a5058344d11d7bc8 (patch)
tree6b456f13178753f7af386fb769c5d232e0180fa7 /Modules
parentc7766245c14fa03b8afd3aff9be30b13d0069f95 (diff)
downloadcpython-eb0c485b6c836abb71932537a5058344d11d7bc8.zip
cpython-eb0c485b6c836abb71932537a5058344d11d7bc8.tar.gz
cpython-eb0c485b6c836abb71932537a5058344d11d7bc8.tar.bz2
gh-101819: Remove _PyWindowsConsoleIO_Type from the Windows DLL (GH-101904)
Automerge-Triggered-By: GH:erlend-aasland
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/_iomodule.h4
-rw-r--r--Modules/_io/winconsoleio.c4
2 files changed, 1 insertions, 7 deletions
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index c260080..7617cb8 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -21,13 +21,9 @@ extern PyTypeObject PyBufferedRandom_Type;
extern PyTypeObject PyTextIOWrapper_Type;
extern PyTypeObject PyIncrementalNewlineDecoder_Type;
-#ifndef Py_LIMITED_API
#ifdef MS_WINDOWS
extern PyTypeObject PyWindowsConsoleIO_Type;
-PyAPI_DATA(PyObject *) _PyWindowsConsoleIO_Type;
-#define PyWindowsConsoleIO_Check(op) (PyObject_TypeCheck((op), (PyTypeObject*)_PyWindowsConsoleIO_Type))
#endif /* MS_WINDOWS */
-#endif /* Py_LIMITED_API */
/* These functions are used as METH_NOARGS methods, are normally called
* with args=NULL, and return a new reference.
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index 4f41ab9..e913d83 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -260,7 +260,7 @@ _io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
int fd_is_own = 0;
HANDLE handle = NULL;
- assert(PyWindowsConsoleIO_Check(self));
+ assert(PyObject_TypeCheck(self, (PyTypeObject *)&PyWindowsConsoleIO_Type));
if (self->fd >= 0) {
if (self->closefd) {
/* Have to close the existing file first. */
@@ -1174,6 +1174,4 @@ PyTypeObject PyWindowsConsoleIO_Type = {
0, /* tp_finalize */
};
-PyObject * _PyWindowsConsoleIO_Type = (PyObject*)&PyWindowsConsoleIO_Type;
-
#endif /* MS_WINDOWS */