[Python-checkins] r87767 - in python/branches/py3k: Doc/whatsnew/3.2.rst Lib/test/test_sys.py
raymond.hettinger
python-checkins at python.org
Wed Jan 5 21:24:08 CET 2011
Author: raymond.hettinger
Date: Wed Jan 5 21:24:08 2011
New Revision: 87767
Log:
Update tests and whatsnew for the 'quiet' flag
Modified:
python/branches/py3k/Doc/whatsnew/3.2.rst
python/branches/py3k/Lib/test/test_sys.py
Modified: python/branches/py3k/Doc/whatsnew/3.2.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/3.2.rst (original)
+++ python/branches/py3k/Doc/whatsnew/3.2.rst Wed Jan 5 21:24:08 2011
@@ -383,7 +383,14 @@
(Suggested by Mark Dickinson and implemented by Eric Smith in :issue:`7094`.)
* The interpreter can now be started with a quiet option, ``-q``, to suppress
- the copyright and version information in an interactive mode.
+ the copyright and version information in an interactive mode. The option can
+ be introspected using the :attr:`sys.flags` attribute::
+
+ $ python -q
+ >>> sys.flags
+ sys.flags(debug=0, division_warning=0, inspect=0, interactive=0,
+ optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0,
+ ignore_environment=0, verbose=0, bytes_warning=0, quiet=1)
(Contributed by Marcin Wojdyr in issue:`1772833`).
Modified: python/branches/py3k/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sys.py (original)
+++ python/branches/py3k/Lib/test/test_sys.py Wed Jan 5 21:24:08 2011
@@ -501,7 +501,7 @@
attrs = ("debug", "division_warning",
"inspect", "interactive", "optimize", "dont_write_bytecode",
"no_user_site", "no_site", "ignore_environment", "verbose",
- "bytes_warning")
+ "bytes_warning", "quiet")
for attr in attrs:
self.assertTrue(hasattr(sys.flags, attr), attr)
self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
More information about the Python-checkins
mailing list