Reduced some code

This commit is contained in:
phill-ridout 2013-02-04 18:27:43 +00:00
parent 98d2247f10
commit bde8df5f86

View File

@ -581,10 +581,9 @@ def strip_rtf(text, default_encoding=None):
try: try:
encoding, default_encoding = get_encoding(font, encoding, default_encoding = get_encoding(font,
font_table, default_encoding, failed=failed) font_table, default_encoding, failed=failed)
if encoding: if not encoding:
out.append(chr(charcode).decode(encoding))
else:
return None return None
out.append(chr(charcode).decode(encoding))
except UnicodeDecodeError: except UnicodeDecodeError:
failed = True failed = True
else: else: