diff --git a/winbuild/build.py b/winbuild/build.py index eee4a4b07..eb98965b5 100644 --- a/winbuild/build.py +++ b/winbuild/build.py @@ -45,7 +45,7 @@ def run_script(params): def header(op): - return r""" + return r""" setlocal set MPLSRC=%%~dp0\.. set INCLIB=%%~dp0\depends diff --git a/winbuild/build_dep.py b/winbuild/build_dep.py index 7a35066ce..acd6a8669 100644 --- a/winbuild/build_dep.py +++ b/winbuild/build_dep.py @@ -2,7 +2,6 @@ from fetch import fetch from unzip import unzip from untar import untar import os, hashlib -import shutil from config import * @@ -33,16 +32,16 @@ def check_sig(filename, signame): def mkdirs(): try: os.mkdir(build_dir) - except: + except OSError: pass try: os.mkdir(inc_dir) - except: + except OSError: pass for compiler in compilers.values(): try: os.mkdir(os.path.join(inc_dir, compiler['inc_dir'])) - except: + except OSError: pass def extract(src, dest): @@ -66,15 +65,6 @@ def fetch_libs(): def extract_binlib(): lib = bin_libs['openjpeg'] extract(lib['filename'], build_dir) - return - base = os.path.splitext(lib['filename'])[0] - for compiler in compilers.values(): - shutil.copy(os.path.join(inc_dir, base, 'include', 'openjpeg-%s' % lib['version']), - os.path.join(inc_dir, compiler['inc_dir'])) - shutil.copy(os.path.join(inc_dir, base, 'bin', 'openjp2.dll'), - os.path.join(inc_dir, compiler['inc_dir'])) - shutil.copy(os.path.join(inc_dir, base, 'lib', 'openjp2.lib'), - os.path.join(inc_dir, compiler['inc_dir'])) def extract_openjpeg(compiler): return r""" @@ -212,9 +202,9 @@ endlocal """ % compiler def msbuild_freetype(compiler): - if compiler['env_version'] == 'v7.1': - return msbuild_freetype_71(compiler) - return msbuild_freetype_70(compiler) + if compiler['env_version'] == 'v7.1': + return msbuild_freetype_71(compiler) + return msbuild_freetype_70(compiler) def msbuild_freetype_71(compiler): return r""" diff --git a/winbuild/config.py b/winbuild/config.py index 08d8920e9..a80e9317d 100644 --- a/winbuild/config.py +++ b/winbuild/config.py @@ -118,7 +118,7 @@ def pyversion_fromEnv(): py = os.environ['PYTHON'] py_version = '27' - for k,v in pythons.items(): + for k in pythons.keys(): if k in py: py_version = k break diff --git a/winbuild/unzip.py b/winbuild/unzip.py index 18588433c..56e6a768e 100644 --- a/winbuild/unzip.py +++ b/winbuild/unzip.py @@ -1,8 +1,8 @@ import sys, zipfile def unzip(src, dest): - with zipfile.ZipFile(src) as zf: - zf.extractall(dest) + with zipfile.ZipFile(src) as zf: + zf.extractall(dest) if __name__=='__main__': - unzip(sys.argv[1], sys.argv[2]) + unzip(sys.argv[1], sys.argv[2])