diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-07 08:06:39 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-07 08:06:39 (GMT) |
commit | 5cfc79deaeabf4af3c767665098a37da9f375eda (patch) | |
tree | 2696e5c9674d11398f0d207d58d1fcdd3ee420eb /Lib/test/test_tcl.py | |
parent | fe4ef392d5df73639337f02db2ad8100d615067d (diff) | |
download | cpython-5cfc79deaeabf4af3c767665098a37da9f375eda.zip cpython-5cfc79deaeabf4af3c767665098a37da9f375eda.tar.gz cpython-5cfc79deaeabf4af3c767665098a37da9f375eda.tar.bz2 |
Issue #20532: Tests which use _testcapi now are marked as CPython only.
Diffstat (limited to 'Lib/test/test_tcl.py')
-rw-r--r-- | Lib/test/test_tcl.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index 3693dfe..dda0c7a 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -1,7 +1,6 @@ import unittest import sys import os -import _testcapi from test import support # Skip this test if the _tkinter module wasn't built. @@ -13,6 +12,11 @@ support.import_fresh_module('tkinter') from tkinter import Tcl from _tkinter import TclError +try: + from _testcapi import INT_MAX, PY_SSIZE_T_MAX +except ImportError: + INT_MAX = PY_SSIZE_T_MAX = sys.maxsize + tcl_version = _tkinter.TCL_VERSION.split('.') try: for i in range(len(tcl_version)): @@ -539,9 +543,9 @@ class BigmemTclTest(unittest.TestCase): def setUp(self): self.interp = Tcl() - @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX, - "needs UINT_MAX < SIZE_MAX") - @support.bigmemtest(size=_testcapi.INT_MAX + 1, memuse=5, dry_run=False) + @support.cpython_only + @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") + @support.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False) def test_huge_string(self, size): value = ' ' * size self.assertRaises(OverflowError, self.interp.call, 'set', '_', value) |