mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
Utilize the currently running Python executable
especially if it matches the module being tested
This commit is contained in:
parent
ee84ae0551
commit
1a81a97e9f
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
from run_utils import Err, log, execute, getPlatformVersion, isColorEnabled, TempEnvDir
|
from run_utils import Err, log, execute, getPlatformVersion, isColorEnabled, TempEnvDir
|
||||||
from run_long import LONG_TESTS_DEBUG_VALGRIND, longTestFilter
|
from run_long import LONG_TESTS_DEBUG_VALGRIND, longTestFilter
|
||||||
|
|
||||||
@ -116,6 +117,8 @@ class TestSuite(object):
|
|||||||
return None, ret
|
return None, ret
|
||||||
elif module in ['python2', 'python3']:
|
elif module in ['python2', 'python3']:
|
||||||
executable = os.getenv('OPENCV_PYTHON_BINARY', None)
|
executable = os.getenv('OPENCV_PYTHON_BINARY', None)
|
||||||
|
if executable is None or module == 'python{}'.format(sys.version_info[0]):
|
||||||
|
executable = sys.executable
|
||||||
if executable is None:
|
if executable is None:
|
||||||
executable = path
|
executable = path
|
||||||
if not self.tryCommand([executable, '--version'], workingDir):
|
if not self.tryCommand([executable, '--version'], workingDir):
|
||||||
|
Loading…
Reference in New Issue
Block a user