Commit 5af60b32 authored by Vincent Pelletier's avatar Vincent Pelletier

caucase.test: Drop dependency on deprecated distutils module.

parent 4966706d
...@@ -31,9 +31,6 @@ except ImportError: # pragma: no cover ...@@ -31,9 +31,6 @@ except ImportError: # pragma: no cover
# BBB: py2.7 # BBB: py2.7
from Cookie import SimpleCookie from Cookie import SimpleCookie
import datetime import datetime
# pylint: disable=no-name-in-module, import-error
from distutils.spawn import find_executable
# pylint: enable=no-name-in-module, import-error
import errno import errno
import functools import functools
import glob import glob
...@@ -3839,12 +3836,19 @@ if getattr(CaucaseTest, 'assertItemsEqual', None) is None: # pragma: no cover ...@@ -3839,12 +3836,19 @@ if getattr(CaucaseTest, 'assertItemsEqual', None) is None: # pragma: no cover
CaucaseTest.assertItemsEqual = CaucaseTest.assertCountEqual CaucaseTest.assertItemsEqual = CaucaseTest.assertCountEqual
# pylint: enable=no-member # pylint: enable=no-member
_caucase_sh_path = find_executable( def _findCaucaseSh():
'caucase.sh', file_directory = os.path.dirname(__file__)
path=os.path.join( caucase_sh = 'caucase.sh'
os.path.dirname(__file__), os.path.pardir, 'shell', for path in [
) + os.path.pathsep + os.getenv('PATH', ''), file_directory,
) os.path.join(file_directory, os.path.pardir, 'shell'),
] + os.getenv('PATH', '').split(os.path.pathsep): # pragma: no cover
result = os.path.join(path, caucase_sh)
if os.path.isfile(result):
return result
return None # pragma: no cover
_caucase_sh_path = _findCaucaseSh()
def _runCaucaseSh(*args): def _runCaucaseSh(*args):
command = (_caucase_sh_path, ) + args command = (_caucase_sh_path, ) + args
environ = os.environ.copy() environ = os.environ.copy()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment