summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-02-09 19:31:45 (GMT)
committerBarry Warsaw <barry@python.org>1999-02-09 19:31:45 (GMT)
commitca74da4e2c0ccbf7c8c54a7ed1a13385f0e205cb (patch)
tree346e7c49cef54f35be0de1ec39e7fddf75c85000 /Modules/posixmodule.c
parent95474f96969381de9d555e9e361da779821e5421 (diff)
downloadcpython-ca74da4e2c0ccbf7c8c54a7ed1a13385f0e205cb.zip
cpython-ca74da4e2c0ccbf7c8c54a7ed1a13385f0e205cb.tar.gz
cpython-ca74da4e2c0ccbf7c8c54a7ed1a13385f0e205cb.tar.bz2
Got rid of the file-global PosixError. This was redundant since it
was just an alias for PyExc_OSError and the way we were doing it was causing a (small) memory leak anyway. Just use PyExc_OSError everywhere.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index f925d6e..013e3b1 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -326,20 +326,18 @@ convertenviron()
}
-static PyObject *PosixError; /* Exception posix.error */
-
/* Set a POSIX-specific error from errno, and return NULL */
static PyObject *
posix_error()
{
- return PyErr_SetFromErrno(PosixError);
+ return PyErr_SetFromErrno(PyExc_OSError);
}
static PyObject *
posix_error_with_filename(name)
char* name;
{
- return PyErr_SetFromErrnoWithFilename(PosixError, name);
+ return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
}
@@ -410,7 +408,7 @@ static PyObject * os2_error(int code)
v = Py_BuildValue("(is)", code, text);
if (v != NULL) {
- PyErr_SetObject(PosixError, v);
+ PyErr_SetObject(PyExc_OSError, v);
Py_DECREF(v);
}
return NULL; /* Signal to Python that an Exception is Pending */
@@ -3482,7 +3480,5 @@ INITFUNC()
if (all_ins(d))
return;
- Py_INCREF(PyExc_OSError);
- PosixError = PyExc_OSError;
- PyDict_SetItemString(d, "error", PosixError);
+ PyDict_SetItemString(d, "error", PyExc_OSError);
}