Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def abort(message):
reporter.error("{} inside {}".format(message, toml_file))
raise SystemExit(1)
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
)
out, err = proc.communicate()
if not proc.returncode:
try:
result = json.loads(out)
except ValueError as exception:
failure = exception
else:
_python_info_cache[cmd] = result
return result.copy()
else:
failure = "exit code {}".format(proc.returncode)
reporter.verbosity1("{!r} cmd {!r} out {!r} err {!r} ".format(failure, cmd, out, err))
def get_executable(self, envconfig):
""" return path object to the executable for the given
name (e.g. python2.7, python3.6, python etc.)
if name is already an existing path, return name.
If an interpreter cannot be found, return None.
"""
try:
return self.name2executable[envconfig.envname]
except KeyError:
exe = self.hook.tox_get_python_executable(envconfig=envconfig)
reporter.verbosity2("{} uses {}".format(envconfig.envname, exe))
self.name2executable[envconfig.envname] = exe
return exe