diff Python/sysmodule.c @ 44038:d44fffda2cd0 legacy-trunk

Expose Py_Py3kWarningFlag as sys.py3kwarning as discussed in #1504 Also added a warning.warnpy3k() as convenient method for Python 3.x related deprecation warnings.
author Christian Heimes <christian@cheimes.de>
date Tue, 27 Nov 2007 23:16:44 +0000
parents 31c92828aefb
children c218d1ac916e
line wrap: on
line diff
--- a/Python/sysmodule.c	Tue Nov 27 22:38:36 2007 +0000
+++ b/Python/sysmodule.c	Tue Nov 27 23:16:44 2007 +0000
@@ -1167,6 +1167,8 @@
 		   	    PyString_FromString(Py_GetExecPrefix()));
 	SET_SYS_FROM_STRING("maxint",
 			    PyInt_FromLong(PyInt_GetMax()));
+	SET_SYS_FROM_STRING("py3kwarning",
+			    PyBool_FromLong(Py_Py3kWarningFlag));
 #ifdef Py_USING_UNICODE
 	SET_SYS_FROM_STRING("maxunicode",
 			    PyInt_FromLong(PyUnicode_GetMax()));