mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-03 19:33:07 +03:00
Flake8 fixes
This commit is contained in:
parent
eecb1ffcad
commit
105e963505
|
@ -2313,7 +2313,7 @@ def open(fp, mode="r"):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
im = _open_core(fp, filename, prefix)
|
im = _open_core(fp, filename, prefix)
|
||||||
|
|
||||||
if im is None:
|
if im is None:
|
||||||
if init():
|
if init():
|
||||||
im = _open_core(fp, filename, prefix)
|
im = _open_core(fp, filename, prefix)
|
||||||
|
@ -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.
|
||||||
|
|
|
@ -28,7 +28,7 @@ class ImagePalette(object):
|
||||||
:param mode: The mode to use for the Palette. See:
|
:param mode: The mode to use for the Palette. See:
|
||||||
:ref:`concept-modes`. Defaults to "RGB"
|
:ref:`concept-modes`. Defaults to "RGB"
|
||||||
:param palette: An optional palette. If given, it must be a bytearray,
|
:param palette: An optional palette. If given, it must be a bytearray,
|
||||||
an array or a list of ints between 0-255 and of length ``size``
|
an array or a list of ints between 0-255 and of length ``size``
|
||||||
times the number of colors in ``mode``. The list must be aligned
|
times the number of colors in ``mode``. The list must be aligned
|
||||||
by channel (All R values must be contiguous in the list before G
|
by channel (All R values must be contiguous in the list before G
|
||||||
and B values.) Defaults to 0 through 255 per channel.
|
and B values.) Defaults to 0 through 255 per channel.
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -54,19 +54,19 @@ 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:
|
||||||
# see https://github.com/travis-ci/travis-ci/issues/3587
|
# see https://github.com/travis-ci/travis-ci/issues/3587
|
||||||
print("Single threaded build for pypy3")
|
print("Single threaded build for pypy3")
|
||||||
return
|
return
|
||||||
|
|
||||||
if fl_win:
|
if fl_win:
|
||||||
#windows barfs on multiprocessing installs
|
#windows barfs on multiprocessing installs
|
||||||
print("Single threaded build for windows")
|
print("Single threaded build for windows")
|
||||||
return
|
return
|
||||||
|
|
||||||
if MAX_PROCS != 1:
|
if MAX_PROCS != 1:
|
||||||
# explicitly don't enable if environment says 1 processor
|
# explicitly don't enable if environment says 1 processor
|
||||||
try:
|
try:
|
||||||
|
@ -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()
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -308,7 +308,7 @@ class pil_build_ext(build_ext):
|
||||||
elif sys.platform.startswith("sunos5"):
|
elif sys.platform.startswith("sunos5"):
|
||||||
_add_directory(library_dirs, "/opt/local/lib")
|
_add_directory(library_dirs, "/opt/local/lib")
|
||||||
_add_directory(include_dirs, "/opt/local/include")
|
_add_directory(include_dirs, "/opt/local/include")
|
||||||
|
|
||||||
# FIXME: check /opt/stuff directories here?
|
# FIXME: check /opt/stuff directories here?
|
||||||
|
|
||||||
# locate tkinter libraries
|
# locate tkinter libraries
|
||||||
|
|
Loading…
Reference in New Issue
Block a user