diff options
author | Skip Montanaro <skip@pobox.com> | 2007-08-12 11:44:53 (GMT) |
---|---|---|
committer | Skip Montanaro <skip@pobox.com> | 2007-08-12 11:44:53 (GMT) |
commit | 46fc337395753e5b927f6dcccc549c54550b197e (patch) | |
tree | 36c450714b34d4ee7f5ae1d1490d4a1ecac254e8 /Modules | |
parent | 447e7c398158323af7757def0cf715fabfc707fa (diff) | |
download | cpython-46fc337395753e5b927f6dcccc549c54550b197e.zip cpython-46fc337395753e5b927f6dcccc549c54550b197e.tar.gz cpython-46fc337395753e5b927f6dcccc549c54550b197e.tar.bz2 |
PyErr_Warn is deprecated in 2.5 - goes away for 3.0
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_bsddb.c | 14 | ||||
-rw-r--r-- | Modules/_ctypes/callbacks.c | 5 | ||||
-rw-r--r-- | Modules/mmapmodule.c | 5 | ||||
-rw-r--r-- | Modules/posixmodule.c | 10 |
4 files changed, 21 insertions, 13 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index d03999f..149cd98 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -546,7 +546,7 @@ static int makeDBError(int err) } _db_errmsg[0] = 0; #ifdef HAVE_WARNINGS - exceptionRaised = PyErr_Warn(PyExc_RuntimeWarning, errTxt); + exceptionRaised = PyErr_WarnEx(PyExc_RuntimeWarning, errTxt, 1); #else fprintf(stderr, errTxt); fprintf(stderr, "\n"); @@ -859,8 +859,10 @@ DB_dealloc(DBObject* self) MYDB_END_ALLOW_THREADS; #ifdef HAVE_WARNINGS } else { - PyErr_Warn(PyExc_RuntimeWarning, - "DB could not be closed in destructor: DBEnv already closed"); + PyErr_WarnEx(PyExc_RuntimeWarning, + "DB could not be closed in destructor:" + " DBEnv already closed", + 1); #endif } self->db = NULL; @@ -1031,8 +1033,10 @@ DBTxn_dealloc(DBTxnObject* self) txn_abort(self->txn); #endif MYDB_END_ALLOW_THREADS; - PyErr_Warn(PyExc_RuntimeWarning, - "DBTxn aborted in destructor. No prior commit() or abort()."); + PyErr_WarnEx(PyExc_RuntimeWarning, + "DBTxn aborted in destructor. " + " No prior commit() or abort().", + 1); } #endif diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c index 5915455..a1a0e0d 100644 --- a/Modules/_ctypes/callbacks.c +++ b/Modules/_ctypes/callbacks.c @@ -225,8 +225,9 @@ if (x == NULL) _AddTraceback(what, __FILE__, __LINE__ - 1), PyErr_Print() else if (keep == Py_None) /* Nothing to keep */ Py_DECREF(keep); else if (setfunc != getentry("O")->setfunc) { - if (-1 == PyErr_Warn(PyExc_RuntimeWarning, - "memory leak in callback function.")) + if (-1 == PyErr_WarnEx(PyExc_RuntimeWarning, + "memory leak in callback function.", + 1)) PyErr_WriteUnraisable(callable); } } diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 269ac90..1626d72 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -998,8 +998,9 @@ new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict) XXX: fileno == 0 is a valid fd, but was accepted prior to 2.5. XXX: Should this code be added? if (fileno == 0) - PyErr_Warn(PyExc_DeprecationWarning, - "don't use 0 for anonymous memory"); + PyErr_WarnEx(PyExc_DeprecationWarning, + "don't use 0 for anonymous memory", + 1); */ if (fileno != -1 && fileno != 0) { fh = (HANDLE)_get_osfhandle(fileno); diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 61ac4e6..d710a73 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5344,8 +5344,9 @@ posix_tempnam(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "|zz:tempnam", &dir, &pfx)) return NULL; - if (PyErr_Warn(PyExc_RuntimeWarning, - "tempnam is a potential security risk to your program") < 0) + if (PyErr_WarnEx(PyExc_RuntimeWarning, + "tempnam is a potential security risk to your program", + 1) < 0) return NULL; #ifdef MS_WINDOWS @@ -5391,8 +5392,9 @@ posix_tmpnam(PyObject *self, PyObject *noargs) char buffer[L_tmpnam]; char *name; - if (PyErr_Warn(PyExc_RuntimeWarning, - "tmpnam is a potential security risk to your program") < 0) + if (PyErr_WarnEx(PyExc_RuntimeWarning, + "tmpnam is a potential security risk to your program", + 1) < 0) return NULL; #ifdef USE_TMPNAM_R |