Issue #20532: Tests which use _testcapi now are marked as CPython only.
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 49bca96..a6e95e5 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 test_support
from subprocess import Popen, PIPE
@@ -11,6 +10,11 @@
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)):
@@ -523,10 +527,9 @@
def setUp(self):
self.interp = Tcl()
- @unittest.skipUnless(_testcapi.INT_MAX < _testcapi.PY_SSIZE_T_MAX,
- "needs UINT_MAX < SIZE_MAX")
- @test_support.precisionbigmemtest(size=_testcapi.INT_MAX + 1, memuse=5,
- dry_run=False)
+ @test_support.cpython_only
+ @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
+ @test_support.precisionbigmemtest(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)