mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Fix gbz80 code search on PyPy
It doesn't support % on bytestrings yet, alas.
This commit is contained in:
parent
a6c63733f0
commit
508b5cd88f
1 changed files with 3 additions and 2 deletions
|
@ -625,8 +625,9 @@ def find_code(haystack, needle, **kwargs):
|
||||||
inner_pattern = b'.' * instr_input.length
|
inner_pattern = b'.' * instr_input.length
|
||||||
|
|
||||||
group_name = pattern_atom.name.encode('ascii')
|
group_name = pattern_atom.name.encode('ascii')
|
||||||
input_table[pattern_atom.name] = b'(?P=%b)' % (group_name,)
|
input_table[pattern_atom.name] = b'(?P=' + group_name + b')'
|
||||||
pattern_chunks.append(b'(?P<%b>%b)' % (group_name, inner_pattern))
|
pattern_chunks.append(
|
||||||
|
b'(?P<' + group_name + b'>' + inner_pattern + b')')
|
||||||
matched_instructions.append((instr, pattern_atoms))
|
matched_instructions.append((instr, pattern_atoms))
|
||||||
|
|
||||||
pattern = b''.join(pattern_chunks)
|
pattern = b''.join(pattern_chunks)
|
||||||
|
|
Loading…
Reference in a new issue