diff options
author | Charles-François Natali <neologix@free.fr> | 2011-11-27 11:41:06 (GMT) |
---|---|---|
committer | Charles-François Natali <neologix@free.fr> | 2011-11-27 11:41:06 (GMT) |
commit | 6613c18ea2b1e8f4ede20313265c10bcdfebb5be (patch) | |
tree | ada703b7ec06b9fec6c8c5d55852288be5009390 /Modules | |
parent | 6d47db31f0d5fe5e9b38c3f02cd436f110ea8b52 (diff) | |
download | cpython-6613c18ea2b1e8f4ede20313265c10bcdfebb5be.zip cpython-6613c18ea2b1e8f4ede20313265c10bcdfebb5be.tar.gz cpython-6613c18ea2b1e8f4ede20313265c10bcdfebb5be.tar.bz2 |
Issue #13415: Test in configure if unsetenv() has a return value or not.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index b8d0021..66cd153 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6185,18 +6185,24 @@ posix_unsetenv(PyObject *self, PyObject *args) { PyObject *os1; char *s1; +#ifndef HAVE_BROKEN_UNSETENV int err; +#endif if (!PyArg_ParseTuple(args, "O&:unsetenv", PyUnicode_FSConverter, &os1)) return NULL; s1 = PyBytes_AsString(os1); +#ifdef HAVE_BROKEN_UNSETENV + unsetenv(s1); +#else err = unsetenv(s1); if (err) { Py_DECREF(os1); return posix_error(); } +#endif /* Remove the key from posix_putenv_garbage; * this will cause it to be collected. This has to |