From 508b5cd88f5447565a52da6121c83922a76c3918 Mon Sep 17 00:00:00 2001 From: "Eevee (Lexy Munroe)" Date: Mon, 19 Dec 2016 16:07:59 -0800 Subject: [PATCH] Fix gbz80 code search on PyPy It doesn't support % on bytestrings yet, alas. --- pokedex/extract/lib/gbz80.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pokedex/extract/lib/gbz80.py b/pokedex/extract/lib/gbz80.py index b7b9f25..b7cde71 100644 --- a/pokedex/extract/lib/gbz80.py +++ b/pokedex/extract/lib/gbz80.py @@ -625,8 +625,9 @@ def find_code(haystack, needle, **kwargs): inner_pattern = b'.' * instr_input.length group_name = pattern_atom.name.encode('ascii') - input_table[pattern_atom.name] = b'(?P=%b)' % (group_name,) - pattern_chunks.append(b'(?P<%b>%b)' % (group_name, inner_pattern)) + input_table[pattern_atom.name] = b'(?P=' + group_name + b')' + pattern_chunks.append( + b'(?P<' + group_name + b'>' + inner_pattern + b')') matched_instructions.append((instr, pattern_atoms)) pattern = b''.join(pattern_chunks)