]> granicus.if.org Git - python/commitdiff
Replace hack in regrtest.py with use of sys.py3kwarning.
authorSteven Bethard <steven.bethard@gmail.com>
Fri, 21 Mar 2008 21:01:18 +0000 (21:01 +0000)
committerSteven Bethard <steven.bethard@gmail.com>
Fri, 21 Mar 2008 21:01:18 +0000 (21:01 +0000)
Lib/test/regrtest.py

index f8eac8c9b7dedd47fcad877994087ed16e49aeed..5706813ca40d499736824481dd5828debc09acae 100755 (executable)
@@ -1164,13 +1164,8 @@ class _ExpectedSkips:
                 self.expected.add('test_sunaudiodev')
                 self.expected.add('test_nis')
 
-            # TODO: This is a hack to raise TestSkipped if -3 is not enabled.
-            # Instead of relying on callable to have a warning, we should expose
-            # the -3 flag to Python code somehow
-            with test_support.catch_warning() as w:
-                callable(int)
-                if w.message is None:
-                    self.expected.add('test_py3kwarn')
+            if not sys.py3kwarning:
+                self.expected.add('test_py3kwarn')
 
             self.valid = True