Merge pull request #139 from gvmori/py2fontfix
FIX: Only check for bytes input to enc() in python3 Note - For python2, no checks have been put in placepull/157/head
commit
653b4f33ee
|
@ -275,7 +275,7 @@ def decode_text(s):
|
||||||
# enc
|
# enc
|
||||||
def enc(x, codec='ascii'):
|
def enc(x, codec='ascii'):
|
||||||
"""Encodes a string for SGML/XML/HTML"""
|
"""Encodes a string for SGML/XML/HTML"""
|
||||||
if isinstance(x, bytes):
|
if six.PY3 and isinstance(x, bytes):
|
||||||
return ''
|
return ''
|
||||||
x = x.replace('&', '&').replace('>', '>').replace('<', '<').replace('"', '"')
|
x = x.replace('&', '&').replace('>', '>').replace('<', '<').replace('"', '"')
|
||||||
if codec:
|
if codec:
|
||||||
|
|
Loading…
Reference in New Issue