]> granicus.if.org Git - python/commitdiff
Restore GIL in nis_cat in case of error.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Aug 2010 16:12:23 +0000 (16:12 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 18 Aug 2010 16:12:23 +0000 (16:12 +0000)
Misc/NEWS
Modules/nismodule.c

index 8a1d414c0978b550227d4ba611c5b7e983276274..59ad9d34a39144d818a832103209736f8814d961 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -57,6 +57,8 @@ Core and Builtins
 Extensions
 ----------
 
+- Restore GIL in nis_cat in case of error.
+
 - Issue #665761: ``functools.reduce()`` will no longer mask exceptions
   other than ``TypeError`` raised by the iterator argument.
 
index 16c7b813b074ea9ffdc9bacf37f7ad93fd6e1b18..d75af5d589cd82966f2c0baa1eaccd935085237e 100644 (file)
@@ -124,6 +124,7 @@ nis_foreach (int instatus, char *inkey, int inkeylen, char *inval,
             PyErr_Clear();
             Py_XDECREF(key);
             Py_XDECREF(val);
+            indata->state = PyEval_SaveThread();
             return 1;
         }
         err = PyDict_SetItem(indata->dict, key, val);