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 /Python | |
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 'Python')
-rw-r--r-- | Python/errors.c | 11 | ||||
-rw-r--r-- | Python/import.c | 8 | ||||
-rw-r--r-- | Python/modsupport.c | 2 | ||||
-rw-r--r-- | Python/structmember.c | 8 |
4 files changed, 9 insertions, 20 deletions
diff --git a/Python/errors.c b/Python/errors.c index 3770522..62e63ab 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -670,17 +670,6 @@ PyErr_WarnEx(PyObject *category, const char *message, Py_ssize_t stack_level) } } -/* PyErr_Warn is only for backwards compatability and will be removed. - Use PyErr_WarnEx instead. */ - -#undef PyErr_Warn - -PyAPI_FUNC(int) -PyErr_Warn(PyObject *category, char *message) -{ - return PyErr_WarnEx(category, message, 1); -} - /* Warning with explicit origin */ int PyErr_WarnExplicit(PyObject *category, const char *message, diff --git a/Python/import.c b/Python/import.c index bb40b68..7ac9e2a 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1320,8 +1320,8 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, sprintf(warnstr, "Not importing directory " "'%.*s': missing __init__.py", MAXPATHLEN, buf); - if (PyErr_Warn(PyExc_ImportWarning, - warnstr)) { + if (PyErr_WarnEx(PyExc_ImportWarning, + warnstr, 1)) { return NULL; } } @@ -1339,8 +1339,8 @@ find_module(char *fullname, char *subname, PyObject *path, char *buf, sprintf(warnstr, "Not importing directory " "'%.*s': missing __init__.py", MAXPATHLEN, buf); - if (PyErr_Warn(PyExc_ImportWarning, - warnstr)) { + if (PyErr_WarnEx(PyExc_ImportWarning, + warnstr, 1)) { return NULL; } } diff --git a/Python/modsupport.c b/Python/modsupport.c index d29fe9b..8f25ed2 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -42,7 +42,7 @@ Py_InitModule4(const char *name, PyMethodDef *methods, const char *doc, api_version_warning, name, PYTHON_API_VERSION, name, module_api_version); - if (PyErr_Warn(PyExc_RuntimeWarning, message)) + if (PyErr_WarnEx(PyExc_RuntimeWarning, message, 1)) return NULL; } /* Make sure name is fully qualified. diff --git a/Python/structmember.c b/Python/structmember.c index e0014c4..3eb7218 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -90,10 +90,10 @@ PyMember_GetOne(const char *addr, PyMemberDef *l) return v; } -#define WARN(msg) \ - do { \ - if (PyErr_Warn(PyExc_RuntimeWarning, msg) < 0) \ - return -1; \ +#define WARN(msg) \ + do { \ + if (PyErr_WarnEx(PyExc_RuntimeWarning, msg, 1) < 0) \ + return -1; \ } while (0) int |