[Python-checkins] r71028 - in python/branches/release26-maint: Python/symtable.c
benjamin.peterson
python-checkins at python.org
Thu Apr 2 04:58:50 CEST 2009
Author: benjamin.peterson
Date: Thu Apr 2 04:58:49 2009
New Revision: 71028
Log:
Merged revisions 71026 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71026 | benjamin.peterson | 2009年04月01日 21:52:46 -0500 (2009年4月01日) | 1 line
fix error handling
........
Modified:
python/branches/release26-maint/ (props changed)
python/branches/release26-maint/Python/symtable.c
Modified: python/branches/release26-maint/Python/symtable.c
==============================================================================
--- python/branches/release26-maint/Python/symtable.c (original)
+++ python/branches/release26-maint/Python/symtable.c Thu Apr 2 04:58:49 2009
@@ -731,7 +731,6 @@
PyObject *global, PyObject* child_free)
{
PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL;
- int success = 0;
/* Copy the bound and global dictionaries.
@@ -758,13 +757,17 @@
if (!analyze_block(entry, temp_bound, temp_free, temp_global))
goto error;
- success = PyDict_Update(child_free, temp_free) >= 0;
- success = 1;
+ if (PyDict_Update(child_free, temp_free) < 0)
+ goto error;
+ Py_DECREF(temp_bound);
+ Py_DECREF(temp_free);
+ Py_DECREF(temp_global);
+ return 1;
error:
Py_XDECREF(temp_bound);
Py_XDECREF(temp_free);
Py_XDECREF(temp_global);
- return success;
+ return 0;
}
static int
More information about the Python-checkins
mailing list