summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-11-23 05:14:47 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-11-23 05:14:47 (GMT)
commite8eb0e82f314f69dda60530480f3234b73466078 (patch)
tree8fec8354b48b421906507f13efca519ab337acc2 /Modules
parente0bcca510ad2af33d1d62a922d8c3d36400f8bcf (diff)
parent4bb867d3ec4f004dc35daf9ae935dc72c5214789 (diff)
downloadcpython-e8eb0e82f314f69dda60530480f3234b73466078.zip
cpython-e8eb0e82f314f69dda60530480f3234b73466078.tar.gz
cpython-e8eb0e82f314f69dda60530480f3234b73466078.tar.bz2
merge 3.2
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 094d071..e42db5b 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7844,12 +7844,16 @@ posix_unsetenv(PyObject *self, PyObject *args)
int err;
if (!PyArg_ParseTuple(args, "O&:unsetenv",
+
PyUnicode_FSConverter, &name))
return NULL;
+
err = unsetenv(PyBytes_AS_STRING(name));
- if (err)
+ if (err) {
+ Py_DECREF(name);
return posix_error();
+ }
/* Remove the key from posix_putenv_garbage;
* this will cause it to be collected. This has to