Skip to content
Snippets Groups Projects
Commit 02c6c846 authored by Jim MacArthur's avatar Jim MacArthur
Browse files

sandbox.py: Use _root in _has_command

This will need more attention when we bring in another virtual
directory backend, however, we've said it is acceptable for the
sandbox itself to access the underlying directory, and this is
the best fix in the meantime.
parent 8edf1f80
No related branches found
No related tags found
Loading
Pipeline #26956496 passed
......@@ -316,11 +316,11 @@ class Sandbox():
def _has_command(self, command, env=None):
if os.path.isabs(command):
return os.path.exists(os.path.join(
self.get_directory(), command.lstrip(os.sep)))
self._root, command.lstrip(os.sep)))
for path in env.get('PATH').split(':'):
if os.path.exists(os.path.join(
self.get_directory(), path.lstrip(os.sep), command)):
self._root, path.lstrip(os.sep), command)):
return True
return False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment