Index: Lib/test/test_py3kwarn.py =================================================================== --- Lib/test/test_py3kwarn.py (revision 61626) +++ Lib/test/test_py3kwarn.py (working copy) @@ -1,14 +1,10 @@ import unittest from test.test_support import catch_warning, TestSkipped, run_unittest import warnings +import sys -# 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 catch_warning() as w: - callable(int) - if w.message is None: - raise TestSkipped('%s must be run with the -3 flag' % __name__) +if not sys.py3kwarning: + raise TestSkipped('%s must be run with the -3 flag' % __name__) class TestPy3KWarnings(unittest.TestCase):