[Python-3000-checkins] r56912 - python/branches/py3k/Python/codecs.c

neal.norwitz python-3000-checkins at python.org
Sat Aug 11 06:58:27 CEST 2007


Author: neal.norwitz
Date: Sat Aug 11 06:58:26 2007
New Revision: 56912

Modified:
   python/branches/py3k/Python/codecs.c
Log:
Handle error

Modified: python/branches/py3k/Python/codecs.c
==============================================================================
--- python/branches/py3k/Python/codecs.c	(original)
+++ python/branches/py3k/Python/codecs.c	Sat Aug 11 06:58:26 2007
@@ -167,7 +167,10 @@
     }
 
     /* Cache and return the result */
-    PyDict_SetItem(interp->codec_search_cache, v, result);
+    if (PyDict_SetItem(interp->codec_search_cache, v, result) < 0) {
+	Py_DECREF(result);
+	goto onError;
+    }
     Py_DECREF(args);
     return result;
 


More information about the Python-3000-checkins mailing list