From: Georg Brandl Date: Fri, 6 Jun 2008 09:02:07 +0000 (+0000) Subject: Fix sys.flags sequence behavior and add a test case. X-Git-Tag: v3.0b1~147 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5e88d5f471056c14ae9d6677cef5473282936ad;p=thirdparty%2FPython%2Fcpython.git Fix sys.flags sequence behavior and add a test case. --- diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 493ef8d5f45c..d09141315120 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -324,12 +324,13 @@ class SysModuleTest(unittest.TestCase): self.failUnless(sys.flags) attrs = ("debug", "division_warning", "inspect", "interactive", "optimize", "dont_write_bytecode", - "no_site", "ignore_environment", "verbose", + "no_user_site", "no_site", "ignore_environment", "verbose", "bytes_warning") for attr in attrs: self.assert_(hasattr(sys.flags, attr), attr) self.assertEqual(type(getattr(sys.flags, attr)), int, attr) self.assert_(repr(sys.flags)) + self.assertEqual(len(sys.flags), len(attrs)) def test_clear_type_cache(self): sys._clear_type_cache() diff --git a/Python/sysmodule.c b/Python/sysmodule.c index de2e91dbd1cc..aebae624984b 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1150,9 +1150,9 @@ static PyStructSequence_Desc flags_desc = { flags__doc__, /* doc */ flags_fields, /* fields */ #ifdef RISCOS - 11 + 12 #else - 10 + 11 #endif };