Issue #20532: Tests which use _testcapi now are marked as CPython only.
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index e8f52a5..7eb104a 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -1,7 +1,6 @@
-import _testcapi
 import unittest
 from test.support import (verbose, refcount_test, run_unittest,
-                            strip_python_stderr)
+                            strip_python_stderr, cpython_only)
 from test.script_helper import assert_python_ok, make_script, temp_dir
 
 import sys
@@ -14,6 +13,15 @@
 except ImportError:
     threading = None
 
+try:
+    from _testcapi import with_tp_del
+except ImportError:
+    def with_tp_del(cls):
+        class C(object):
+            def __new__(cls, *args, **kwargs):
+                raise TypeError('requires _testcapi.with_tp_del')
+        return C
+
 ### Support code
 ###############################################################################
 
@@ -41,7 +49,7 @@
         # gc collects it.
         self.wr = weakref.ref(C1055820(666), it_happened)
 
-@_testcapi.with_tp_del
+@with_tp_del
 class Uncollectable(object):
     """Create a reference cycle with multiple __del__ methods.
 
@@ -143,10 +151,11 @@
         del a
         self.assertNotEqual(gc.collect(), 0)
 
+    @cpython_only
     def test_legacy_finalizer(self):
         # A() is uncollectable if it is part of a cycle, make sure it shows up
         # in gc.garbage.
-        @_testcapi.with_tp_del
+        @with_tp_del
         class A:
             def __tp_del__(self): pass
         class B:
@@ -168,10 +177,11 @@
             self.fail("didn't find obj in garbage (finalizer)")
         gc.garbage.remove(obj)
 
+    @cpython_only
     def test_legacy_finalizer_newclass(self):
         # A() is uncollectable if it is part of a cycle, make sure it shows up
         # in gc.garbage.
-        @_testcapi.with_tp_del
+        @with_tp_del
         class A(object):
             def __tp_del__(self): pass
         class B(object):
@@ -570,6 +580,7 @@
             # would be damaged, with an empty __dict__.
             self.assertEqual(x, None)
 
+    @cpython_only
     def test_garbage_at_shutdown(self):
         import subprocess
         code = """if 1:
@@ -764,6 +775,7 @@
             info = v[2]
             self.assertEqual(info["generation"], 2)
 
+    @cpython_only
     def test_collect_garbage(self):
         self.preclean()
         # Each of these cause four objects to be garbage: Two