diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-06-04 22:13:51 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-06-04 22:13:51 (GMT) |
commit | 9d77664e012a04da43177b218b7fb521e7aeb438 (patch) | |
tree | 4580cb7474fe4e79c6697cf4d4636984eeb709a4 /Objects/namespaceobject.c | |
parent | a2d56984c72519a0ea046025876f92efcf40f2b2 (diff) | |
download | cpython-9d77664e012a04da43177b218b7fb521e7aeb438.zip cpython-9d77664e012a04da43177b218b7fb521e7aeb438.tar.gz cpython-9d77664e012a04da43177b218b7fb521e7aeb438.tar.bz2 |
Issue #9566: Fix a compiler warning on Windows 64-bit in namespace_init()
The result type is int, return -1 to avoid a compiler warning (cast Py_ssize_t
to int). PyObject_Size() can only fail with -1, and anyway a constructor
should return -1 on error, not an arbitrary negative number.
Diffstat (limited to 'Objects/namespaceobject.c')
-rw-r--r-- | Objects/namespaceobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 7e9107a..8c51b07 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -44,7 +44,7 @@ namespace_init(_PyNamespaceObject *ns, PyObject *args, PyObject *kwds) if (args != NULL) { Py_ssize_t argcount = PyObject_Size(args); if (argcount < 0) - return argcount; + return -1; else if (argcount > 0) { PyErr_Format(PyExc_TypeError, "no positional arguments expected"); return -1; |