summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-01-14 03:31:43 (GMT)
committerGuido van Rossum <guido@python.org>2007-01-14 03:31:43 (GMT)
commitddefaf31b366ea84250fc5090837c2b764a04102 (patch)
treeab3d7b5172f4e6a064165468fc70beb41bdca1d3 /Objects/exceptions.c
parent5b787e8bc2dbda5583eee039cb6a6e47c8d8a034 (diff)
downloadcpython-ddefaf31b366ea84250fc5090837c2b764a04102.zip
cpython-ddefaf31b366ea84250fc5090837c2b764a04102.tar.gz
cpython-ddefaf31b366ea84250fc5090837c2b764a04102.tar.bz2
Merged the int/long unification branch, by very crude means (sorry Thomas!).
I banged on the code (beyond what's in that branch) to make fewer tests fail; the only tests that fail now are: test_descr -- can't pickle ints?! test_pickletools -- ??? test_socket -- See python.org/sf/1619659 test_sqlite -- ??? I'll deal with those later.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 0cd819c..9e298f0 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1089,7 +1089,7 @@ SyntaxError_str(PySyntaxErrorObject *self)
have_filename = (self->filename != NULL) &&
PyString_Check(self->filename);
- have_lineno = (self->lineno != NULL) && PyInt_Check(self->lineno);
+ have_lineno = (self->lineno != NULL) && PyInt_CheckExact(self->lineno);
if (!have_filename && !have_lineno)
return str;
@@ -1225,10 +1225,8 @@ get_int(PyObject *attr, Py_ssize_t *value, const char *name)
return -1;
}
- if (PyInt_Check(attr)) {
- *value = PyInt_AS_LONG(attr);
- } else if (PyLong_Check(attr)) {
- *value = _PyLong_AsSsize_t(attr);
+ if (PyLong_Check(attr)) {
+ *value = PyLong_AsSsize_t(attr);
if (*value == -1 && PyErr_Occurred())
return -1;
} else {
@@ -1515,8 +1513,8 @@ UnicodeError_init(PyUnicodeErrorObject *self, PyObject *args, PyObject *kwds,
if (!PyArg_ParseTuple(args, "O!O!O!O!O!",
&PyString_Type, &self->encoding,
objecttype, &self->object,
- &PyInt_Type, &self->start,
- &PyInt_Type, &self->end,
+ &PyLong_Type, &self->start,
+ &PyLong_Type, &self->end,
&PyString_Type, &self->reason)) {
self->encoding = self->object = self->start = self->end =
self->reason = NULL;
@@ -1748,8 +1746,8 @@ UnicodeTranslateError_init(PyUnicodeErrorObject *self, PyObject *args,
if (!PyArg_ParseTuple(args, "O!O!O!O!",
&PyUnicode_Type, &self->object,
- &PyInt_Type, &self->start,
- &PyInt_Type, &self->end,
+ &PyLong_Type, &self->start,
+ &PyLong_Type, &self->end,
&PyString_Type, &self->reason)) {
self->object = self->start = self->end = self->reason = NULL;
return -1;