All format handlers compatible with python3 except chm

This commit is contained in:
Jean-Francois Dockes
2018-03-09 15:25:11 +01:00
parent 7f49de5d97
commit 93ac830079
13 changed files with 45 additions and 58 deletions
+4 -12
View File
@@ -39,18 +39,10 @@ else:
import io
import keyword, token, tokenize
if PY2:
def makebytes(data):
if isinstance(data, unicode):
return data.encode("UTF-8")
else:
return data
else:
def makebytes(data):
if isinstance(data, bytes):
return data
else:
return data.encode("UTF-8")
def makebytes(data):
if type(data) == type(u''):
return data.encode("UTF-8")
return data
#############################################################################
### Python Source Parser (does Hilighting)