[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fix relocate-preamble.py bug (issue 560840043 by address@hidden)
From: |
knupero |
Subject: |
Fix relocate-preamble.py bug (issue 560840043 by address@hidden) |
Date: |
Tue, 30 Jul 2019 15:32:46 -0700 |
Reviewers: ,
Message:
Please review. See 'Re: Patchy email' thread in lilypond-devel.
Knut
Description:
Fix relocate-preamble.py bug
In relocate-preamble.py the search
path for python modules is changed.
If a python script / module used
in our regression tests is changed,
the results of "make test-baseline",
"make test" and patchy are random
without this patch: Fresh scripts
could load modules installed by an
older version of lilypond.
Please review this at https://codereview.appspot.com/560840043/
Affected files (+7, -0 lines):
M python/relocate-preamble.py.in
Index: python/relocate-preamble.py.in
diff --git a/python/relocate-preamble.py.in b/python/relocate-preamble.py.in
index
13bae3983145b7184ce83859f2faebd608a8da19..8896e8ca0f1187a7f67893862888c334daaa91a5
100644
--- a/python/relocate-preamble.py.in
+++ b/python/relocate-preamble.py.in
@@ -16,4 +16,11 @@ bindir = os.path.abspath (os.path.dirname (sys.argv[0]))
for p in ['share', 'lib']:
datadir = os.path.abspath (bindir
+ '/../%s/lilypond/current/python/' % p)
sys.path.insert (0, datadir)
+
+# Python scripts executed during 'make test' and 'make test-baseline'
+# must use their own versions of the scripts and the files loaded by
+# those scripts. Assume to be in such a situation if the path to the
+# script ends with 'scripts/out'.
+if bindir.endswith (r'/scripts/out'):
+ sys.path.insert (0, bindir + r'/../../python/out')
"""
- Fix relocate-preamble.py bug (issue 560840043 by address@hidden),
knupero <=