Skip to content

Commit ff8859d

Browse files
authored
bpo-45402: Fix test_tools.test_sundry() (GH-28786)
Fix test_tools.test_sundry() when Python is built out of tree: fix how the freeze_modules.py tool locates the _freeze_module program.
1 parent 32485ce commit ff8859d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix test_tools.test_sundry() when Python is built out of tree: fix how
2+
the freeze_modules.py tool locates the _freeze_module program.
3+
Patch by Victor Stinner.

Tools/scripts/freeze_modules.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
if sys.platform != "win32":
3030
TOOL = os.path.join(ROOT_DIR, 'Programs', '_freeze_module')
3131
if not os.path.isfile(TOOL):
32-
# When building out of the source tree, get the tool from the current
33-
# directory
34-
TOOL = os.path.join('Programs', '_freeze_module')
32+
# When building out of the source tree, get the tool from directory
33+
# of the Python executable
34+
TOOL = os.path.dirname(sys.executable)
35+
TOOL = os.path.join(TOOL, 'Programs', '_freeze_module')
3536
TOOL = os.path.abspath(TOOL)
3637
if not os.path.isfile(TOOL):
3738
sys.exit("ERROR: missing _freeze_module")

0 commit comments

Comments
 (0)