Skip to content

Commit 77dc809

Browse files
committed
Remove and replace encoding.text_type
1 parent c412680 commit 77dc809

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

gitdb/utils/encoding.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
91
def force_bytes(data, encoding="ascii"):
102
if isinstance(data, bytes):
113
return data
@@ -17,13 +9,10 @@ def force_bytes(data, encoding="ascii"):
179

1810

1911
def force_text(data, encoding="utf-8"):
20-
if isinstance(data, text_type):
12+
if isinstance(data, str):
2113
return data
2214

2315
if isinstance(data, bytes):
2416
return data.decode(encoding)
2517

26-
if compat.PY3:
27-
return text_type(data, encoding)
28-
else:
29-
return text_type(data)
18+
return str(data, encoding)

0 commit comments

Comments
 (0)