Fix regressions introduced by autopep8

This commit is contained in:
Kovid Goyal 2019-03-25 13:45:24 +05:30
parent 33cea777ac
commit ba70f43118
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 3 additions and 3 deletions

View File

@ -652,7 +652,7 @@ class LrfWriter(object):
return self.sourceEncoding return self.sourceEncoding
def toUnicode(self, string): def toUnicode(self, string):
if isinstance(string, str): if isinstance(string, bytes):
string = string.decode(self.sourceEncoding) string = string.decode(self.sourceEncoding)
return string return string

View File

@ -121,7 +121,7 @@ def create_markdown_object(extensions):
if hasattr(module, 'makeExtension'): if hasattr(module, 'makeExtension'):
return module.makeExtension(**configs) return module.makeExtension(**configs)
for name, x in vars(module).items(): for name, x in vars(module).items():
if isinstance(x, type) and issubclass(x, Extension) and x is not Extension: if type(x) is type and issubclass(x, Extension) and x is not Extension:
return x(**configs) return x(**configs)
raise ImportError('No extension class in {}'.format(ext_name)) raise ImportError('No extension class in {}'.format(ext_name))

View File

@ -139,7 +139,7 @@ def string_diff(left, right, left_syntax=None, right_syntax=None, left_name='lef
def file_diff(left, right): def file_diff(left, right):
(raw1, syntax1), (raw2, syntax2) = map(get_decoded_raw, (left, right)) (raw1, syntax1), (raw2, syntax2) = map(get_decoded_raw, (left, right))
if not isinstance(raw1, type(raw2)): if type(raw1) is not type(raw2):
raw1, raw2 = open(left, 'rb').read(), open(right, 'rb').read() raw1, raw2 = open(left, 'rb').read(), open(right, 'rb').read()
cache = Cache() cache = Cache()
cache.set_left(left, raw1), cache.set_right(right, raw2) cache.set_left(left, raw1), cache.set_right(right, raw2)