[Python-checkins] cpython: Minor cleanup.
raymond.hettinger
python-checkins at python.org
Fri Aug 14 11:20:04 CEST 2015
https://hg.python.org/cpython/rev/a1daf32d920e
changeset: 97378:a1daf32d920e
user: Raymond Hettinger <python at rcn.com>
date: Fri Aug 14 02:07:41 2015 -0700
summary:
Minor cleanup.
files:
Modules/_collectionsmodule.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
--- a/Modules/_collectionsmodule.c
+++ b/Modules/_collectionsmodule.c
@@ -2167,13 +2167,13 @@
oldval = _PyDict_GetItem_KnownHash(mapping, key, hash);
if (oldval == NULL) {
- if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) == -1)
+ if (_PyDict_SetItem_KnownHash(mapping, key, one, hash) < 0)
goto done;
} else {
newval = PyNumber_Add(oldval, one);
if (newval == NULL)
goto done;
- if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) == -1)
+ if (_PyDict_SetItem_KnownHash(mapping, key, newval, hash) < 0)
goto done;
Py_CLEAR(newval);
}
@@ -2199,7 +2199,7 @@
Py_DECREF(oldval);
if (newval == NULL)
break;
- if (PyObject_SetItem(mapping, key, newval) == -1)
+ if (PyObject_SetItem(mapping, key, newval) < 0)
break;
Py_CLEAR(newval);
Py_DECREF(key);
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list