1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-20 21:21:35 +02:00

Removing couple of "buildins" polyglot types

This commit is contained in:
2020-04-20 20:22:50 +02:00
parent eac0b98d6f
commit c867f0321b
36 changed files with 85 additions and 109 deletions
+1 -7
View File
@@ -21,10 +21,7 @@ def as_bytes(x, encoding='utf-8'):
return bytes(x)
if isinstance(x, memoryview):
return x.tobytes()
ans = str(x)
if isinstance(ans, str):
ans = ans.encode(encoding)
return ans
return str(x).encode(encoding)
def as_unicode(x, encoding='utf-8', errors='strict'):
@@ -45,9 +42,6 @@ def reraise(tp, value, tb=None):
tb = None
string_or_bytes = str, bytes
string_or_unicode = str
long_type = int
raw_input = input
getcwd = os.getcwd
getenv = os.getenv