mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
linux installer: fix python3 re.sub with mismatched str/bytes
This does not seem to have been a very commonly hit case, since it's been broken for python3 since before 2014, but a user has just hit it for the first time. Fixes #1851873
This commit is contained in:
parent
d47c332723
commit
0163b537dc
@ -163,7 +163,7 @@ class TerminalController: # {{{
|
||||
if isinstance(cap_name, bytes):
|
||||
cap_name = cap_name.decode('utf-8')
|
||||
cap = self._escape_code(curses.tigetstr(cap_name))
|
||||
return re.sub(r'\$<\d+>[/*]?', b'', cap)
|
||||
return re.sub(r'\$<\d+>[/*]?', '', cap)
|
||||
|
||||
def render(self, template):
|
||||
return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
|
||||
|
@ -212,7 +212,7 @@ class TerminalController: # {{{
|
||||
if isinstance(cap_name, bytes):
|
||||
cap_name = cap_name.decode('utf-8')
|
||||
cap = self._escape_code(curses.tigetstr(cap_name))
|
||||
return re.sub(r'\$<\d+>[/*]?', b'', cap)
|
||||
return re.sub(r'\$<\d+>[/*]?', '', cap)
|
||||
|
||||
def render(self, template):
|
||||
return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
|
||||
|
Loading…
x
Reference in New Issue
Block a user