1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Fri, 24 Jan 2025 11:14:20 +0100
Subject: Revert "always use raw-string for regex (manual)"
Forwarded: not-needed
This reverts commit 3720de10d2ab7d0e647335fa148b96bd3bd5bdc0.
---
src/calibre/ebooks/unihandecode/jadecoder.py | 2 +-
src/calibre/ebooks/unihandecode/unidecoder.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/calibre/ebooks/unihandecode/jadecoder.py b/src/calibre/ebooks/unihandecode/jadecoder.py
index 16a31fc..64e8445 100644
--- a/src/calibre/ebooks/unihandecode/jadecoder.py
+++ b/src/calibre/ebooks/unihandecode/jadecoder.py
@@ -90,4 +90,4 @@ class Jadecoder(Unidecoder):
text = self.conv.do(text)
except Exception:
pass
- return re.sub(r'[^\x00-\x7f]', lambda x: self.replace_point(x.group()), text)
+ return re.sub('[^\x00-\x7f]', lambda x: self.replace_point(x.group()), text)
diff --git a/src/calibre/ebooks/unihandecode/unidecoder.py b/src/calibre/ebooks/unihandecode/unidecoder.py
index aba5069..6d7c9f1 100644
--- a/src/calibre/ebooks/unihandecode/unidecoder.py
+++ b/src/calibre/ebooks/unihandecode/unidecoder.py
@@ -73,7 +73,7 @@ class Unidecoder:
def decode(self, text):
# Replace characters larger than 127 with their ASCII equivalent.
- return re.sub(r'[^\x00-\x7f]', lambda x: self.replace_point(x.group()), text)
+ return re.sub('[^\x00-\x7f]',lambda x: self.replace_point(x.group()), text)
def replace_point(self, codepoint):
'''
|