summaryrefslogtreecommitdiff
path: root/Objects/intobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r--Objects/intobject.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 74955adbef..1ae8006c28 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -1059,8 +1059,14 @@ int_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:int", kwlist,
&x, &base))
return NULL;
- if (x == NULL)
+ if (x == NULL) {
+ if (base != -909) {
+ PyErr_SetString(PyExc_TypeError,
+ "int() missing string argument");
+ return NULL;
+ }
return PyInt_FromLong(0L);
+ }
if (base == -909)
return PyNumber_Int(x);
if (PyString_Check(x)) {