From: Guido van Rossum Date: Mon, 12 Aug 2002 21:54:46 +0000 (+0000) Subject: Use PyErr_WarnExplicit() to warn about hex/oct constants, so the X-Git-Tag: v2.3c1~4520 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=715eca932e9ceaefbb4a3dcc21671b02dd7b4112;p=thirdparty%2FPython%2Fcpython.git Use PyErr_WarnExplicit() to warn about hex/oct constants, so the correct filename and line number are reported. --- diff --git a/Python/compile.c b/Python/compile.c index dbff9b03ae68..b160f7361255 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1157,10 +1157,15 @@ parsenumber(struct compiling *co, char *s) if (s[0] == '0') { x = (long) PyOS_strtoul(s, &end, 0); if (x < 0 && errno == 0) { - if (PyErr_Warn(PyExc_DeprecationWarning, - "hex/oct constants > sys.maxint " - "will return positive values " - "in Python 2.4 and up") < 0) + if (PyErr_WarnExplicit( + PyExc_DeprecationWarning, + "hex/oct constants > sys.maxint " + "will return positive values " + "in Python 2.4 and up", + co->c_filename, + co->c_lineno, + NULL, + NULL) < 0) return NULL; errno = 0; /* Might be changed by PyErr_Warn() */ }