Fixes #26793: convert insert regex to_bytes before searching

(cherry picked from commit fcad4f38b4)
pull/29940/head
Anton Baklanov 7 years ago committed by Toshio Kuratomi
parent 75309386d7
commit 1478d0fcf3

@ -253,9 +253,9 @@ def main():
insertafter = 'EOF' insertafter = 'EOF'
if insertafter not in (None, 'EOF'): if insertafter not in (None, 'EOF'):
insertre = re.compile(insertafter) insertre = re.compile(to_bytes(insertafter, errors='surrogate_or_strict'))
elif insertbefore not in (None, 'BOF'): elif insertbefore not in (None, 'BOF'):
insertre = re.compile(insertbefore) insertre = re.compile(to_bytes(insertbefore, errors='surrogate_or_strict'))
else: else:
insertre = None insertre = None

Loading…
Cancel
Save