mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regressions introduced by autopep8
This commit is contained in:
parent
33cea777ac
commit
ba70f43118
@ -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
|
||||||
|
@ -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))
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user