Flake8 fixes

This commit is contained in:
Andrew Murray 2015-09-11 19:28:19 +10:00
parent eecb1ffcad
commit 105e963505
5 changed files with 13 additions and 11 deletions

View File

@ -2327,6 +2327,7 @@ def open(fp, mode="r"):
# #
# Image processing. # Image processing.
def alpha_composite(im1, im2): def alpha_composite(im1, im2):
""" """
Alpha composite im2 over im1. Alpha composite im2 over im1.

View File

@ -551,7 +551,7 @@ class ImageFileDirectory(collections.MutableMapping):
# NUL (binary zero). Also, I don't think this was well # NUL (binary zero). Also, I don't think this was well
# exercised before. # exercised before.
if sys.version_info[0] == 2: if sys.version_info[0] == 2:
value = value.decode('ascii','replace') value = value.decode('ascii', 'replace')
data = value = b"" + value.encode('ascii', 'replace') + b"\0" data = value = b"" + value.encode('ascii', 'replace') + b"\0"
else: else:
# integer data # integer data

View File

@ -54,7 +54,7 @@ def _mp_compile(self, sources, output_dir=None, macros=None,
def install(): def install():
fl_pypy3 = hasattr(sys, 'pypy_version_info') and sys.version_info > (3,0) fl_pypy3 = hasattr(sys, 'pypy_version_info') and sys.version_info > (3, 0)
fl_win = sys.platform.startswith('win') fl_win = sys.platform.startswith('win')
if fl_pypy3: if fl_pypy3:
@ -75,9 +75,10 @@ def install():
pool = Pool(2) pool = Pool(2)
CCompiler.compile = _mp_compile CCompiler.compile = _mp_compile
except Exception as msg: except Exception as msg:
print("Exception installing mp_compile, proceeding without: %s" % msg) print("Exception installing mp_compile, proceeding without:"
"%s" % msg)
else: else:
print("Single threaded build, not installing mp_compile: %s processes" % print("Single threaded build, not installing mp_compile:"
MAX_PROCS) "%s processes" % MAX_PROCS)
install() install()