Simplify string cleansing in fallback update script

No behavioural change
This commit is contained in:
teor (Tim Wilson-Brown) 2016-04-29 11:47:13 +10:00
parent d41f92b006
commit ab06b79cba

View File

@ -219,8 +219,7 @@ def cleanse_unprintable(raw_string):
# Remove all unprintable characters
cleansed_string = ''
for c in raw_string:
if (c in string.ascii_letters or c in string.digits
or c in string.punctuation or c in string.whitespace):
if c in string.printable:
cleansed_string += c
return cleansed_string