[Python-checkins] cpython (3.5): odictobject.c: fix compiler warning

victor.stinner python-checkins at python.org
Fri Sep 18 13:56:07 CEST 2015


https://hg.python.org/cpython/rev/e8f5502f7724
changeset:   98042:e8f5502f7724
branch:      3.5
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Sep 18 13:44:11 2015 +0200
summary:
  odictobject.c: fix compiler warning

PyObject_Length() returns a P_ssize_t, not an int. Use a Py_ssize_t to avoid
overflow.

files:
  Objects/odictobject.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/odictobject.c b/Objects/odictobject.c
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -998,7 +998,7 @@
         goto Done;
     else {
         PyObject *empty, *od_vars, *iterator, *key;
-        int ns_len;
+        Py_ssize_t ns_len;
 
         /* od.__dict__ isn't necessarily a dict... */
         ns = PyObject_CallMethod((PyObject *)vars, "copy", NULL);

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list