Show More
@@ -79,6 +79,23 b' def cleanup_exit():' | |||
|
79 | 79 | print "# Cleaning up HGTMP", HGTMP |
|
80 | 80 | shutil.rmtree(HGTMP, True) |
|
81 | 81 | |
|
82 | def use_correct_python(): | |
|
83 | # some tests run python interpreter. they must use same | |
|
84 | # interpreter we use or bad things will happen. | |
|
85 | exedir, exename = os.path.split(sys.executable) | |
|
86 | if exename == 'python': | |
|
87 | path = find_program('python') | |
|
88 | if os.path.dirname(path) == exedir: | |
|
89 | return | |
|
90 | vlog('# Making python executable in test path use correct Python') | |
|
91 | my_python = os.path.join(BINDIR, 'python') | |
|
92 | try: | |
|
93 | os.symlink(sys.executable, my_python) | |
|
94 | except AttributeError: | |
|
95 | # windows fallback | |
|
96 | shutil.copyfile(sys.executable, my_python) | |
|
97 | shutil.copymode(sys.executable, my_python) | |
|
98 | ||
|
82 | 99 | def install_hg(): |
|
83 | 100 | vlog("# Performing temporary installation of HG") |
|
84 | 101 | installerrs = os.path.join("tests", "install.err") |
@@ -102,6 +119,8 b' def install_hg():' | |||
|
102 | 119 | os.environ["PATH"] = "%s%s%s" % (BINDIR, os.pathsep, os.environ["PATH"]) |
|
103 | 120 | os.environ["PYTHONPATH"] = PYTHONDIR |
|
104 | 121 | |
|
122 | use_correct_python() | |
|
123 | ||
|
105 | 124 | if coverage: |
|
106 | 125 | vlog("# Installing coverage wrapper") |
|
107 | 126 | os.environ['COVERAGE_FILE'] = COVERAGE_FILE |
General Comments 0
You need to be logged in to leave comments.
Login now