Skip to content

Commit 6698ac1

Browse files
committed
windows: blackify
1 parent 2d13ada commit 6698ac1

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

cpython-windows/build.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ def build_openssl_for_arch(
11011101
openssl_version = DOWNLOADS["openssl"]["version"]
11021102
nasm_version = DOWNLOADS["nasm-windows-bin"]["version"]
11031103
jom_version = DOWNLOADS["jom-windows-bin"]["version"]
1104-
1104+
11051105
log("extracting %s to %s" % (openssl_archive, build_root))
11061106
extract_tar_to_directory(openssl_archive, build_root)
11071107
log("extracting %s to %s" % (nasm_archive, build_root))
@@ -1111,7 +1111,7 @@ def build_openssl_for_arch(
11111111

11121112
nasm_path = build_root / ("cpython-bin-deps-nasm-%s" % nasm_version)
11131113
jom_path = build_root / "jom"
1114-
1114+
11151115
env = dict(os.environ)
11161116
# Add Perl and nasm paths to front of PATH.
11171117
env["PATH"] = "%s;%s;%s;%s" % (perl_path.parent, nasm_path, jom_path, env["PATH"])
@@ -1158,14 +1158,15 @@ def build_openssl_for_arch(
11581158
"--prefix=/%s" % prefix,
11591159
],
11601160
source_root,
1161-
{
1162-
**env,
1163-
'CFLAGS': env.get('CFLAGS', '') + ' /FS',
1164-
},
1161+
{**env, "CFLAGS": env.get("CFLAGS", "") + " /FS",},
11651162
)
11661163

1167-
#exec_and_log(["nmake"], source_root, env)
1168-
exec_and_log([str(jom_path / "jom"), "/J", str(multiprocessing.cpu_count())], source_root, env)
1164+
# exec_and_log(["nmake"], source_root, env)
1165+
exec_and_log(
1166+
[str(jom_path / "jom"), "/J", str(multiprocessing.cpu_count())],
1167+
source_root,
1168+
env,
1169+
)
11691170

11701171
# We don't care about accessory files, docs, etc. So just run `install_sw`
11711172
# target to get the main files.
@@ -1197,12 +1198,24 @@ def build_openssl(perl_path: pathlib.Path, arch: str, profile: str):
11971198
if arch == "x86":
11981199
root_32.mkdir()
11991200
build_openssl_for_arch(
1200-
perl_path, "x86", openssl_archive, nasm_archive, root_32, profile, jom_archive = jom_archive,
1201+
perl_path,
1202+
"x86",
1203+
openssl_archive,
1204+
nasm_archive,
1205+
root_32,
1206+
profile,
1207+
jom_archive=jom_archive,
12011208
)
12021209
elif arch == "amd64":
12031210
root_64.mkdir()
12041211
build_openssl_for_arch(
1205-
perl_path, "amd64", openssl_archive, nasm_archive, root_64, profile, jom_archive = jom_archive,
1212+
perl_path,
1213+
"amd64",
1214+
openssl_archive,
1215+
nasm_archive,
1216+
root_64,
1217+
profile,
1218+
jom_archive=jom_archive,
12061219
)
12071220
else:
12081221
raise ValueError("unhandled arch: %s" % arch)
@@ -1985,7 +1998,7 @@ def main():
19851998

19861999
LOG_PREFIX[0] = "cpython"
19872000
tar_path = build_cpython(
1988-
args.python, arch, sh_exe=pathlib.Path(args.sh), profile=args.profile
2001+
args.python, arch, sh_exe=pathlib.Path(args.sh), profile=args.profile,
19892002
)
19902003

19912004
compress_python_archive(

pythonbuild/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ def extract_tar_to_directory(source: pathlib.Path, dest: pathlib.Path):
165165
with tarfile.open(source, "r") as tf:
166166
tf.extractall(dest)
167167

168+
168169
def extract_zip_to_directory(source: pathlib.Path, dest: pathlib.Path):
169170
with zipfile.ZipFile(source, "r") as zf:
170171
zf.extractall(dest)

0 commit comments

Comments
 (0)