summaryrefslogtreecommitdiffstats
path: root/Modules/_io/_iomodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/_iomodule.c')
-rw-r--r--Modules/_io/_iomodule.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 116688d..9ecc671 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -241,11 +241,6 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
PyObject *raw, *modeobj = NULL, *buffer, *wrapper, *result = NULL, *path_or_fd = NULL;
- _Py_IDENTIFIER(_blksize);
- _Py_IDENTIFIER(isatty);
- _Py_IDENTIFIER(mode);
- _Py_IDENTIFIER(close);
-
is_number = PyNumber_Check(file);
if (is_number) {
@@ -381,7 +376,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
/* buffering */
if (buffering < 0) {
- PyObject *res = _PyObject_CallMethodIdNoArgs(raw, &PyId_isatty);
+ PyObject *res = PyObject_CallMethodNoArgs(raw, &_Py_ID(isatty));
if (res == NULL)
goto error;
isatty = PyLong_AsLong(res);
@@ -399,7 +394,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
if (buffering < 0) {
PyObject *blksize_obj;
- blksize_obj = _PyObject_GetAttrId(raw, &PyId__blksize);
+ blksize_obj = PyObject_GetAttr(raw, &_Py_ID(_blksize));
if (blksize_obj == NULL)
goto error;
buffering = PyLong_AsLong(blksize_obj);
@@ -466,7 +461,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
result = wrapper;
Py_DECREF(buffer);
- if (_PyObject_SetAttrId(wrapper, &PyId_mode, modeobj) < 0)
+ if (PyObject_SetAttr(wrapper, &_Py_ID(mode), modeobj) < 0)
goto error;
Py_DECREF(modeobj);
return result;
@@ -475,7 +470,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
if (result != NULL) {
PyObject *exc, *val, *tb, *close_result;
PyErr_Fetch(&exc, &val, &tb);
- close_result = _PyObject_CallMethodIdNoArgs(result, &PyId_close);
+ close_result = PyObject_CallMethodNoArgs(result, &_Py_ID(close));
_PyErr_ChainExceptions(exc, val, tb);
Py_XDECREF(close_result);
Py_DECREF(result);