We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c412680 commit 77dc809Copy full SHA for 77dc809
gitdb/utils/encoding.py
@@ -1,11 +1,3 @@
1
-from gitdb.utils import compat
2
-
3
-if compat.PY3:
4
- text_type = str
5
-else:
6
- text_type = unicode
7
8
9
def force_bytes(data, encoding="ascii"):
10
if isinstance(data, bytes):
11
return data
@@ -17,13 +9,10 @@ def force_bytes(data, encoding="ascii"):
17
18
19
def force_text(data, encoding="utf-8"):
20
- if isinstance(data, text_type):
12
+ if isinstance(data, str):
21
13
22
14
23
15
24
16
return data.decode(encoding)
25
26
- if compat.PY3:
27
- return text_type(data, encoding)
28
- else:
29
- return text_type(data)
+ return str(data, encoding)
0 commit comments