hybrid dis.py from CPython 3.13.10

This commit is contained in:
Jeong, YunWon
2025-12-12 16:26:56 +09:00
committed by Jeong YunWon
parent d11604995a
commit 152d10bfea
4 changed files with 1054 additions and 5 deletions

1054
Lib/dis.py vendored

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,6 @@ class OpListTests(unittest.TestCase):
self.check_bool_function_result(_opcode.has_local, invalid, False)
self.check_bool_function_result(_opcode.has_exc, invalid, False)
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'dis' has no attribute 'opmap'
def test_is_valid(self):
names = [
'CACHE',
@@ -39,7 +38,6 @@ class OpListTests(unittest.TestCase):
opcodes = [dis.opmap[opname] for opname in names]
self.check_bool_function_result(_opcode.is_valid, opcodes, True)
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'dis' has no attribute 'hasarg'
def test_oplists(self):
def check_function(self, func, expected):
for op in [-10, 520]:

View File

@@ -1070,8 +1070,6 @@ if 1:
elif instr.opname in HANDLED_JUMPS:
self.assertNotEqual(instr.arg, (line + 1)*INSTR_SIZE)
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_no_wraparound_jump(self):
# See https://bugs.python.org/issue46724

View File

@@ -1799,7 +1799,6 @@ print(f'''{{
self.assertIn(rb'\1', stdout)
self.assertEqual(len(stderr.strip().splitlines()), 2)
@unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: module 'dis' has no attribute 'get_instructions'
def test_fstring_without_formatting_bytecode(self):
# f-string without any formatting should emit the same bytecode
# as a normal string. See gh-99606.