mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#6780: fix complex() constructor TypeError message
This commit is contained in:
parent
b6a6f5f886
commit
f961377e99
1 changed files with 1 additions and 1 deletions
|
@ -783,7 +783,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
|
||||||
}
|
}
|
||||||
else if (PyObject_AsCharBuffer(v, &s, &len)) {
|
else if (PyObject_AsCharBuffer(v, &s, &len)) {
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
"complex() arg is not a string");
|
"complex() argument must be a string or a number");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue