Revert "Backport METH_FASTCALL from Python 3.7 (#328)"

This reverts commit cf73bbd678.
This commit is contained in:
Justine Tunney 2022-05-12 06:49:54 -07:00
parent e7611a8476
commit 2ea1dc405c
102 changed files with 3299 additions and 2894 deletions

View file

@ -5,7 +5,6 @@ from test.bytecode_helper import BytecodeTestCase
import difflib
import unittest
import sys
import cosmo
import dis
import io
import re
@ -345,15 +344,10 @@ class DisTests(unittest.TestCase):
return re.sub(r'\b0x[0-9A-Fa-f]+\b', '0x...', text)
def do_disassembly_test(self, func, expected):
t = self.maxDiff
self.maxDiff = None # to get full disassembly
got = self.get_disassembly(func)
if got != expected:
got = self.strip_addresses(got)
# filename issue because within zip store?
expected = expected.replace(".pyc", ".py")
self.assertEqual(got, expected)
self.maxDiff = t
def test_opmap(self):
self.assertEqual(dis.opmap["NOP"], 9)
@ -620,13 +614,11 @@ class CodeInfoTests(unittest.TestCase):
(async_def, code_info_async_def)
]
@unittest.skipIf("tiny" in cosmo.MODE, "docstrings not present")
def test_code_info(self):
self.maxDiff = 1000
for x, expected in self.test_pairs:
self.assertRegex(dis.code_info(x), expected)
@unittest.skipIf("tiny" in cosmo.MODE, "docstrings not present")
def test_show_code(self):
self.maxDiff = 1000
for x, expected in self.test_pairs:
@ -942,7 +934,6 @@ class BytecodeTests(unittest.TestCase):
actual = dis.Bytecode(simple, first_line=350).dis()[:3]
self.assertEqual(actual, "350")
@unittest.skipIf("tiny" in cosmo.MODE, "docstrings not present")
def test_info(self):
self.maxDiff = 1000
for x, expected in CodeInfoTests.test_pairs: