mirror of
https://github.com/python/cpython.git
synced 2025-07-27 21:24:32 +00:00
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:
parent
715ec1818d
commit
28104c58d2
5 changed files with 27 additions and 3 deletions
|
@ -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()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue