summaryrefslogtreecommitdiffstats
path: root/Modules/_io/textio.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-03-30 06:09:41 (GMT)
committerGitHub <noreply@github.com>2017-03-30 06:09:41 (GMT)
commitba85d69a3e3610bdd05f0dd372cf4ebca178c7fb (patch)
treefe0766c34601880610c3399a8f01c35ab6e8fe8e /Modules/_io/textio.c
parente6911a44f69c0d302db60f49952a9cf69da69a2b (diff)
downloadcpython-ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb.zip
cpython-ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb.tar.gz
cpython-ba85d69a3e3610bdd05f0dd372cf4ebca178c7fb.tar.bz2
bpo-29878: Add global instances of int for 0 and 1. (#852)
Diffstat (limited to 'Modules/_io/textio.c')
-rw-r--r--Modules/_io/textio.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index fce662a..0211ad9 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1078,7 +1078,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
if (cookieObj == NULL)
goto error;
- cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_EQ);
+ cmp = PyObject_RichCompareBool(cookieObj, _PyLong_Zero, Py_EQ);
Py_DECREF(cookieObj);
if (cmp < 0) {
goto error;
@@ -1087,7 +1087,7 @@ _io_TextIOWrapper___init___impl(textio *self, PyObject *buffer,
if (cmp == 0) {
self->encoding_start_of_stream = 0;
res = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_setstate,
- _PyIO_zero, NULL);
+ _PyLong_Zero, NULL);
if (res == NULL)
goto error;
Py_DECREF(res);
@@ -2030,7 +2030,7 @@ _textiowrapper_encoder_reset(textio *self, int start_of_stream)
}
else {
res = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_setstate,
- _PyIO_zero, NULL);
+ _PyLong_Zero, NULL);
self->encoding_start_of_stream = 0;
}
if (res == NULL)
@@ -2075,7 +2075,7 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence)
if (whence == 1) {
/* seek relative to current position */
- cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_EQ);
+ cmp = PyObject_RichCompareBool(cookieObj, _PyLong_Zero, Py_EQ);
if (cmp < 0)
goto fail;
@@ -2094,7 +2094,7 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence)
}
else if (whence == 2) {
/* seek relative to end of file */
- cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_EQ);
+ cmp = PyObject_RichCompareBool(cookieObj, _PyLong_Zero, Py_EQ);
if (cmp < 0)
goto fail;
@@ -2123,7 +2123,7 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence)
goto fail;
if (self->encoder) {
/* If seek() == 0, we are at the start of stream, otherwise not */
- cmp = PyObject_RichCompareBool(res, _PyIO_zero, Py_EQ);
+ cmp = PyObject_RichCompareBool(res, _PyLong_Zero, Py_EQ);
if (cmp < 0 || _textiowrapper_encoder_reset(self, cmp)) {
Py_DECREF(res);
goto fail;
@@ -2137,7 +2137,7 @@ _io_TextIOWrapper_seek_impl(textio *self, PyObject *cookieObj, int whence)
goto fail;
}
- cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_LT);
+ cmp = PyObject_RichCompareBool(cookieObj, _PyLong_Zero, Py_LT);
if (cmp < 0)
goto fail;