summaryrefslogtreecommitdiff
path: root/demoscript/Util.py
diff options
context:
space:
mode:
Diffstat (limited to 'demoscript/Util.py')
-rw-r--r--demoscript/Util.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/demoscript/Util.py b/demoscript/Util.py
index ebe8fa3704a..0fab3417ac7 100644
--- a/demoscript/Util.py
+++ b/demoscript/Util.py
@@ -55,7 +55,15 @@ host = "127.0.0.1"
#
debug = False
-
+def getJavaVersion():
+ p = subprocess.Popen(javaCmd + " -version", shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT)
+ if(p.wait() != 0):
+ print(javaCmd + " -version failed:\n" + p.stdout.read().strip())
+ sys.exit(1)
+ matchVersion = re.compile('java version \"(.*)\"')
+ m = matchVersion.match(p.stdout.readline().decode('UTF-8'))
+ return m.group(1)
+
class filereader(Expect.reader):
def __init__(self, desc, p):
Expect.reader.__init__(self, desc, p, None)