]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Fix type of re.sub() call in sql tests
authorDenis Laxalde <denis.laxalde@dalibo.com>
Tue, 2 Nov 2021 10:30:00 +0000 (11:30 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 3 Nov 2021 15:53:47 +0000 (16:53 +0100)
All values of re.sub() must be of the type, here bytes.

tests/test_sql.py

index 46d78f9e607d104a58e1c6e862b32ff267e7c606..4deac7e2a25a4275ba63cbe9548c1018d915dd47 100644 (file)
@@ -555,6 +555,6 @@ def noe(s):
     if isinstance(s, str):
         return re.sub(r"\bE'", "'", s)
     elif isinstance(s, bytes):
-        return re.sub(br"\bE'", "'", s)
+        return re.sub(rb"\bE'", b"'", s)
     else:
         raise TypeError(f"not dealing with {type(s).__name__}: {s}")