[Python-checkins] cpython: move var declaration to top of block to fix compilation on Windows, fixes
christian.heimes
python-checkins at python.org
Sat Oct 6 17:14:16 CEST 2012
http://hg.python.org/cpython/rev/f56a49e74178
changeset: 79522:f56a49e74178
user: Christian Heimes <christian at cheimes.de>
date: Sat Oct 06 17:13:29 2012 +0200
summary:
move var declaration to top of block to fix compilation on Windows, fixes a7ec0a1b0f7c
files:
Objects/abstract.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Objects/abstract.c b/Objects/abstract.c
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -78,8 +78,10 @@
Py_ssize_t
PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
{
+ PyObject *hint;
+ Py_ssize_t res;
_Py_IDENTIFIER(__length_hint__);
- Py_ssize_t res = PyObject_Length(o);
+ res = PyObject_Length(o);
if (res < 0 && PyErr_Occurred()) {
if (!PyErr_ExceptionMatches(PyExc_TypeError)) {
return -1;
@@ -89,7 +91,7 @@
else {
return res;
}
- PyObject *hint = _PyObject_LookupSpecial(o, &PyId___length_hint__);
+ hint = _PyObject_LookupSpecial(o, &PyId___length_hint__);
if (hint == NULL) {
if (PyErr_Occurred()) {
return -1;
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list