mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Top level flake8 fixes
This commit is contained in:
parent
5e3bf95c84
commit
2f09622516
|
@ -5,6 +5,7 @@ from multiprocessing import Pool, cpu_count
|
|||
from distutils.ccompiler import CCompiler
|
||||
import os
|
||||
|
||||
|
||||
# hideous monkeypatching. but. but. but.
|
||||
def _mp_compile_one(tp):
|
||||
(self, obj, build, cc_args, extra_postargs, pp_opts) = tp
|
||||
|
@ -15,6 +16,7 @@ def _mp_compile_one(tp):
|
|||
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
|
||||
return
|
||||
|
||||
|
||||
def _mp_compile(self, sources, output_dir=None, macros=None,
|
||||
include_dirs=None, debug=0, extra_preargs=None,
|
||||
extra_postargs=None, depends=None):
|
||||
|
@ -25,12 +27,10 @@ def _mp_compile(self, sources, output_dir=None, macros=None,
|
|||
# A concrete compiler class can either override this method
|
||||
# entirely or implement _compile().
|
||||
|
||||
macros, objects, extra_postargs, pp_opts, build = \
|
||||
self._setup_compile(output_dir, macros, include_dirs, sources,
|
||||
depends, extra_postargs)
|
||||
macros, objects, extra_postargs, pp_opts, build = self._setup_compile(
|
||||
output_dir, macros, include_dirs, sources, depends, extra_postargs)
|
||||
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
|
||||
|
||||
|
||||
try:
|
||||
max_procs = int(os.environ.get('MAX_CONCURRENCY', cpu_count()))
|
||||
except:
|
||||
|
@ -38,10 +38,12 @@ def _mp_compile(self, sources, output_dir=None, macros=None,
|
|||
pool = Pool(max_procs)
|
||||
try:
|
||||
print ("Building using %d processes" % pool._processes)
|
||||
except: pass
|
||||
arr = [(self, obj, build, cc_args, extra_postargs, pp_opts) for obj in objects]
|
||||
results = pool.map_async(_mp_compile_one,arr)
|
||||
|
||||
except:
|
||||
pass
|
||||
arr = [
|
||||
(self, obj, build, cc_args, extra_postargs, pp_opts) for obj in objects
|
||||
]
|
||||
pool.map_async(_mp_compile_one, arr)
|
||||
pool.close()
|
||||
pool.join()
|
||||
# Return *all* object filenames, not just the ones we just built.
|
||||
|
|
3
setup.py
3
setup.py
|
@ -14,8 +14,6 @@ import re
|
|||
import struct
|
||||
import sys
|
||||
|
||||
import mp_compile
|
||||
|
||||
from distutils.command.build_ext import build_ext
|
||||
from distutils import sysconfig
|
||||
from setuptools import Extension, setup, find_packages
|
||||
|
@ -742,5 +740,4 @@ if __name__=='__main__':
|
|||
license='Standard PIL License',
|
||||
zip_safe=True,
|
||||
)
|
||||
|
||||
# End of file
|
||||
|
|
|
@ -4,8 +4,8 @@ import os
|
|||
import sys
|
||||
import glob
|
||||
|
||||
# monkey with the path, removing the local directory but adding the Tests/ directory
|
||||
# for helper.py and the other local imports there.
|
||||
# monkey with the path, removing the local directory but adding the Tests/
|
||||
# directory for helper.py and the other local imports there.
|
||||
|
||||
del(sys.path[0])
|
||||
sys.path.insert(0, os.path.abspath('./Tests'))
|
||||
|
|
Loading…
Reference in New Issue
Block a user