diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-04-12 23:44:07 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-04-12 23:44:07 +0000 |
commit | e9746890388178bb1e4cdad3c0586bf1862c3727 (patch) | |
tree | 77e228e19ac5673aac13dac8292281fc9a3010ab /Python/sysmodule.c | |
parent | e6c03033afc58804cfdb143bef67e9cd37e25507 (diff) | |
download | cpython-git-e9746890388178bb1e4cdad3c0586bf1862c3727.tar.gz |
Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the
parser). It could also potentially lead to a speed-up in interpreter start-up
if the C version of the code (_warnings) is imported over the use of the
Python version in key places.
Closes issue #1631171.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index e733ceedcb..d6ccd17b5a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -940,6 +940,12 @@ PySys_AddWarnOption(char *s) } } +int +PySys_HasWarnOptions(void) +{ + return warnoptions ? 1 : 0; +} + /* XXX This doc string is too long to be a single string literal in VC++ 5.0. Two literals concatenated works just fine. If you have a K&R compiler or other abomination that however *does* understand longer strings, @@ -1165,6 +1171,7 @@ static PyStructSequence_Field flags_fields[] = { /* {"unbuffered", "-u"}, */ {"unicode", "-U"}, /* {"skip_first", "-x"}, */ + {"bytes_warning", "-b"}, {0} }; @@ -1211,6 +1218,7 @@ make_flags(void) /* SetFlag(saw_unbuffered_flag); */ SetFlag(Py_UnicodeFlag); /* SetFlag(skipfirstline); */ + SetFlag(Py_BytesWarningFlag); #undef SetFlag if (PyErr_Occurred()) { |