mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Fix sys.flags sequence behavior and add a test case.
This commit is contained in:
parent
9a5df4d3b7
commit
c5e88d5f47
2 changed files with 4 additions and 3 deletions
|
@ -324,12 +324,13 @@ class SysModuleTest(unittest.TestCase):
|
||||||
self.failUnless(sys.flags)
|
self.failUnless(sys.flags)
|
||||||
attrs = ("debug", "division_warning",
|
attrs = ("debug", "division_warning",
|
||||||
"inspect", "interactive", "optimize", "dont_write_bytecode",
|
"inspect", "interactive", "optimize", "dont_write_bytecode",
|
||||||
"no_site", "ignore_environment", "verbose",
|
"no_user_site", "no_site", "ignore_environment", "verbose",
|
||||||
"bytes_warning")
|
"bytes_warning")
|
||||||
for attr in attrs:
|
for attr in attrs:
|
||||||
self.assert_(hasattr(sys.flags, attr), attr)
|
self.assert_(hasattr(sys.flags, attr), attr)
|
||||||
self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
|
self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
|
||||||
self.assert_(repr(sys.flags))
|
self.assert_(repr(sys.flags))
|
||||||
|
self.assertEqual(len(sys.flags), len(attrs))
|
||||||
|
|
||||||
def test_clear_type_cache(self):
|
def test_clear_type_cache(self):
|
||||||
sys._clear_type_cache()
|
sys._clear_type_cache()
|
||||||
|
|
|
@ -1150,9 +1150,9 @@ static PyStructSequence_Desc flags_desc = {
|
||||||
flags__doc__, /* doc */
|
flags__doc__, /* doc */
|
||||||
flags_fields, /* fields */
|
flags_fields, /* fields */
|
||||||
#ifdef RISCOS
|
#ifdef RISCOS
|
||||||
11
|
12
|
||||||
#else
|
#else
|
||||||
10
|
11
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue