summaryrefslogtreecommitdiffstats
path: root/Objects/intobject.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-05-26 12:51:38 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-05-26 12:51:38 (GMT)
commit593daf545bd9b7e7bcb27b498ecc6f36db9ae395 (patch)
treec0a57029b9ab0eb18a2bb4f8fd65f0817f1a1707 /Objects/intobject.c
parentc3cb683d638e9d660c18a05293a576f98965166e (diff)
downloadcpython-593daf545bd9b7e7bcb27b498ecc6f36db9ae395.zip
cpython-593daf545bd9b7e7bcb27b498ecc6f36db9ae395.tar.gz
cpython-593daf545bd9b7e7bcb27b498ecc6f36db9ae395.tar.bz2
Renamed PyString to PyBytes
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r--Objects/intobject.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index eacad9d..2af9451 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -368,7 +368,7 @@ PyInt_FromString(char *s, char **pend, int base)
if (*end != '\0') {
bad:
slen = strlen(s) < 200 ? strlen(s) : 200;
- sobj = PyString_FromStringAndSize(s, slen);
+ sobj = PyBytes_FromStringAndSize(s, slen);
if (sobj == NULL)
return NULL;
srepr = PyObject_Repr(sobj);
@@ -377,7 +377,7 @@ PyInt_FromString(char *s, char **pend, int base)
return NULL;
PyErr_Format(PyExc_ValueError,
"invalid literal for int() with base %d: %s",
- base, PyString_AS_STRING(srepr));
+ base, PyBytes_AS_STRING(srepr));
Py_DECREF(srepr);
return NULL;
}
@@ -965,11 +965,11 @@ int_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return PyInt_FromLong(0L);
if (base == -909)
return PyNumber_Int(x);
- if (PyString_Check(x)) {
+ if (PyBytes_Check(x)) {
/* Since PyInt_FromString doesn't have a length parameter,
* check here for possible NULs in the string. */
- char *string = PyString_AS_STRING(x);
- if (strlen(string) != PyString_Size(x)) {
+ char *string = PyBytes_AS_STRING(x);
+ if (strlen(string) != PyBytes_Size(x)) {
/* create a repr() of the input string,
* just like PyInt_FromString does */
PyObject *srepr;
@@ -978,7 +978,7 @@ int_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
PyErr_Format(PyExc_ValueError,
"invalid literal for int() with base %d: %s",
- base, PyString_AS_STRING(srepr));
+ base, PyBytes_AS_STRING(srepr));
Py_DECREF(srepr);
return NULL;
}
@@ -1106,7 +1106,7 @@ _PyInt_Format(PyIntObject *v, int base, int newstyle)
if (negative)
*--p = '-';
- return PyString_FromStringAndSize(p, &buf[sizeof(buf)] - p);
+ return PyBytes_FromStringAndSize(p, &buf[sizeof(buf)] - p);
}
static PyObject *
@@ -1116,7 +1116,7 @@ int__format__(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
return NULL;
- if (PyString_Check(format_spec))
+ if (PyBytes_Check(format_spec))
return string_int__format__(self, args);
if (PyUnicode_Check(format_spec)) {
/* Convert format_spec to a str */