summaryrefslogtreecommitdiffstats
path: root/Tools/freeze
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2021-11-11 02:01:53 (GMT)
committerGitHub <noreply@github.com>2021-11-11 02:01:53 (GMT)
commit1cbaa505d007e11c4a1f0d2073d72b6c02c7147c (patch)
tree671391d64df20ebcf2960fae83030e61f5527aa3 /Tools/freeze
parentfc9b62281931da8d20f85d5ed44cfc24f068d3f4 (diff)
downloadcpython-1cbaa505d007e11c4a1f0d2073d72b6c02c7147c.zip
cpython-1cbaa505d007e11c4a1f0d2073d72b6c02c7147c.tar.gz
cpython-1cbaa505d007e11c4a1f0d2073d72b6c02c7147c.tar.bz2
bpo-45696: Deep-freeze selected modules (GH-29118)
This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems. The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new. Windows version TBD.
Diffstat (limited to 'Tools/freeze')
-rw-r--r--Tools/freeze/test/freeze.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/Tools/freeze/test/freeze.py b/Tools/freeze/test/freeze.py
index 18a5d27..387f1ff 100644
--- a/Tools/freeze/test/freeze.py
+++ b/Tools/freeze/test/freeze.py
@@ -22,13 +22,23 @@ class UnsupportedError(Exception):
def _run_quiet(cmd, cwd=None):
#print(f'# {" ".join(shlex.quote(a) for a in cmd)}')
- return subprocess.run(
- cmd,
- cwd=cwd,
- capture_output=True,
- text=True,
- check=True,
- )
+ try:
+ return subprocess.run(
+ cmd,
+ cwd=cwd,
+ capture_output=True,
+ text=True,
+ check=True,
+ )
+ except subprocess.CalledProcessError as err:
+ # Don't be quiet if things fail
+ print(f"{err.__class__.__name__}: {err}")
+ print("--- STDOUT ---")
+ print(err.stdout)
+ print("--- STDERR ---")
+ print(err.stderr)
+ print("---- END ----")
+ raise
def _run_stdout(cmd, cwd=None):