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.
This commit is contained in:
Christian Heimes 2007-11-27 23:16:44 +00:00
parent 715ec1818d
commit 28104c58d2
5 changed files with 27 additions and 3 deletions

View file

@ -1167,6 +1167,8 @@ _PySys_Init(void)
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()));