From 64e733f5521f0816ea438750ed18ca2daca515d6 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 11 Sep 2015 23:54:57 +1000 Subject: [PATCH] Style changes --- PIL/TiffImagePlugin.py | 16 ++++++---------- mp_compile.py | 6 ++---- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index b0e7c9639..4d16ced48 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -428,8 +428,7 @@ class ImageFileDirectory(collections.MutableMapping): ifd = fp.read(12) if len(ifd) != 12: - warnings.warn("Possibly corrupt EXIF data. " - "Expecting to read 12 bytes but only got %d." + warnings.warn("Possibly corrupt EXIF data. Expecting to read 12 bytes but only got %d." % (len(ifd))) continue @@ -467,9 +466,8 @@ class ImageFileDirectory(collections.MutableMapping): data = ifd[8:8+size] if len(data) != size: - warnings.warn("Possibly corrupt EXIF data. " - "Expecting to read %d bytes but only got %d. " - "Skipping tag %s" % (size, len(data), tag)) + warnings.warn("Possibly corrupt EXIF data. Expecting to read %d bytes but only got %d. Skipping tag %s" + % (size, len(data), tag)) continue self.tagdata[tag] = data @@ -484,8 +482,7 @@ class ImageFileDirectory(collections.MutableMapping): ifd = fp.read(4) if len(ifd) != 4: - warnings.warn("Possibly corrupt EXIF data. " - "Expecting to read 4 bytes but only got %d." + warnings.warn("Possibly corrupt EXIF data. Expecting to read 4 bytes but only got %d." % (len(ifd))) return @@ -704,9 +701,8 @@ class TiffImageFile(ImageFile.ImageFile): if not self.__next: raise EOFError("no more images in TIFF file") if DEBUG: - print("Seeking to frame %s, on frame %s, " - "__next %s, location: %s" % - (frame, self.__frame, self.__next, self.fp.tell())) + print("Seeking to frame %s, on frame %s, __next %s, location: %s" + % (frame, self.__frame, self.__next, self.fp.tell())) # reset python3 buffered io handle in case fp # was passed to libtiff, invalidating the buffer self.fp.tell() diff --git a/mp_compile.py b/mp_compile.py index 078f62476..93ddbe99b 100644 --- a/mp_compile.py +++ b/mp_compile.py @@ -75,10 +75,8 @@ def install(): pool = Pool(2) CCompiler.compile = _mp_compile except Exception as msg: - print("Exception installing mp_compile, proceeding without:" - "%s" % msg) + print("Exception installing mp_compile, proceeding without: %s" % msg) else: - print("Single threaded build, not installing mp_compile:" - "%s processes" % MAX_PROCS) + print("Single threaded build, not installing mp_compile: %s processes" % MAX_PROCS) install()