Allow isprintable() util function to work with unicode

Fixes #6842
pull/6359/merge
James Cammarata 11 years ago
parent 1c9950678a
commit ee0a0b492b

@ -1,9 +1,12 @@
def isprintable(instring):
if isinstance(instring, str):
#http://stackoverflow.com/a/3637294
import string
printset = set(string.printable)
isprintable = set(instring).issubset(printset)
return isprintable
else:
return True
def count_newlines_from_end(str):
i = len(str)

Loading…
Cancel
Save