summaryrefslogtreecommitdiffstats
path: root/PC/layout/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'PC/layout/main.py')
-rw-r--r--PC/layout/main.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/PC/layout/main.py b/PC/layout/main.py
index 3ca49d0..305cb51 100644
--- a/PC/layout/main.py
+++ b/PC/layout/main.py
@@ -285,14 +285,13 @@ def _compile_one_py(src, dest, name, optimize, checked=True):
log_warning("Failed to compile {}", src)
return None
+
# name argument added to address bpo-37641
def _py_temp_compile(src, name, ns, dest_dir=None, checked=True):
if not ns.precompile or src not in PY_FILES or src.parent in DATA_DIRS:
return None
dest = (dest_dir or ns.temp) / (src.stem + ".pyc")
- return _compile_one_py(
- src, dest, name, optimize=2, checked=checked
- )
+ return _compile_one_py(src, dest, name, optimize=2, checked=checked)
def _write_to_zip(zf, dest, src, ns, checked=True):
@@ -497,6 +496,13 @@ def main():
"-b", "--build", metavar="dir", help="Specify the build directory", type=Path
)
parser.add_argument(
+ "--arch",
+ metavar="architecture",
+ help="Specify the target architecture",
+ type=str,
+ default=None,
+ )
+ parser.add_argument(
"--doc-build",
metavar="dir",
help="Specify the docs build directory",
@@ -587,6 +593,8 @@ def main():
ns.doc_build = (Path.cwd() / ns.doc_build).resolve()
if ns.include_cat and not ns.include_cat.is_absolute():
ns.include_cat = (Path.cwd() / ns.include_cat).resolve()
+ if not ns.arch:
+ ns.arch = "amd64" if sys.maxsize > 2 ** 32 else "win32"
if ns.copy and not ns.copy.is_absolute():
ns.copy = (Path.cwd() / ns.copy).resolve()
@@ -602,6 +610,7 @@ def main():
Source: {ns.source}
Build: {ns.build}
Temp: {ns.temp}
+Arch: {ns.arch}
Copy to: {ns.copy}
Zip to: {ns.zip}
@@ -609,6 +618,15 @@ Catalog: {ns.catalog}""",
ns=ns,
)
+ if ns.arch not in ("win32", "amd64", "arm32", "arm64"):
+ log_error("--arch is not a valid value (win32, amd64, arm32, arm64)")
+ return 4
+ if ns.arch in ("arm32", "arm64"):
+ for n in ("include_idle", "include_tcltk"):
+ if getattr(ns, n):
+ log_warning(f"Disabling --{n.replace('_', '-')} on unsupported platform")
+ setattr(ns, n, False)
+
if ns.include_idle and not ns.include_tcltk:
log_warning("Assuming --include-tcltk to support --include-idle")
ns.include_tcltk = True