summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2020-06-10 14:20:17 -0400
committerJoe George <joe@zeroc.com>2020-06-10 14:22:25 -0400
commite7395b4d6338129850601c80e703ffceaa6c8b6c (patch)
treeeba88c0e42332fc00c9e29f0e887e8a643093357 /scripts/Util.py
parentUpdate id used to register the IceLocatorDiscovery locator object (diff)
downloadice-e7395b4d6338129850601c80e703ffceaa6c8b6c.tar.bz2
ice-e7395b4d6338129850601c80e703ffceaa6c8b6c.tar.xz
ice-e7395b4d6338129850601c80e703ffceaa6c8b6c.zip
Improve slice2py lookup in test suite
Diffstat (limited to 'scripts/Util.py')
-rw-r--r--scripts/Util.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/scripts/Util.py b/scripts/Util.py
index 1e8b2b127d8..2f9e29798a9 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -1419,7 +1419,7 @@ class ProcessFromBinDir:
#
# Executables for processes inheriting this marker class are only provided
-# as a Release executble on Windows
+# as a Release executable on Windows
#
class ProcessIsReleaseOnly:
@@ -1433,20 +1433,15 @@ class SliceTranslator(ProcessFromBinDir, ProcessIsReleaseOnly, SimpleClient):
def getCommandLine(self, current, args=""):
#
- # Look for slice2py installed by Pip if not found in the bin directory
+ # Look for slice2py installed by pip if not found in the bin directory
#
if self.exe == "slice2py":
translator = self.getMapping(current).getCommandLine(current, self, self.getExe(current), "")
- if os.path.exists(translator):
- return translator + " " + args if args else translator
- elif isinstance(platform, Windows):
- return os.path.join(os.path.dirname(sys.executable), "Scripts", "slice2py.exe")
- elif os.path.exists("/usr/local/bin/slice2py"):
- return "/usr/local/bin/slice2py"
- else:
- import slice2py
- return sys.executable + " " + os.path.normpath(
- os.path.join(slice2py.__file__, "..", "..", "..", "..", "bin", "slice2py"))
+ if not os.path.exists(translator):
+ # TODO: Switch to "sys.executable -m slice2py" once Ice 3.7.5 is released
+ # See https://github.com/zeroc-ice/ice/issues/893
+ translator = sys.executable + " -c " + "'import slice2py; slice2py.main()'"
+ return (translator + " " + args).strip()
else:
return Process.getCommandLine(self, current, args)