summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2018-11-07 10:03:50 +0100
committerBenoit Foucher <benoit@zeroc.com>2018-11-07 10:03:50 +0100
commitd35a16de5e1d49150788843aa6ca18dc43a9af93 (patch)
treef846724239dc371350a8b5b378aea92b5c66e7fb /scripts/Util.py
parentFix for NodeJs deprecation warnings (diff)
downloadice-d35a16de5e1d49150788843aa6ca18dc43a9af93.tar.bz2
ice-d35a16de5e1d49150788843aa6ca18dc43a9af93.tar.xz
ice-d35a16de5e1d49150788843aa6ca18dc43a9af93.zip
Minor fixes for CI test failures
Diffstat (limited to 'scripts/Util.py')
-rw-r--r--scripts/Util.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/Util.py b/scripts/Util.py
index 17368970c3f..ad614017350 100644
--- a/scripts/Util.py
+++ b/scripts/Util.py
@@ -24,10 +24,8 @@ import Expect
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
def run(cmd, cwd=None, err=False, stdout=False, stdin=None, stdinRepeat=True):
- if stdout:
- p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
- else:
- p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=cwd)
+ p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=None if stdout else subprocess.PIPE,
+ stderr=subprocess.STDOUT, cwd=cwd)
try:
if stdin:
try:
@@ -50,7 +48,10 @@ def run(cmd, cwd=None, err=False, stdout=False, stdin=None, stdinRepeat=True):
# ResourceWarning: unclosed file <_io.TextIOWrapper name=3 encoding='cp1252'>
#
(p.stderr if stdout else p.stdout).close()
- p.stdin.close()
+ try:
+ p.stdin.close()
+ except Exception:
+ pass
return out
def val(v, escapeQuotes=False, quoteValue=True):
@@ -1901,7 +1902,7 @@ class TestSuite(object):
def isMainThreadOnly(self, driver):
if self.runOnMainThread or driver.getComponent().isMainThreadOnly(self.id):
return True
- for m in [CppMapping, JavaMapping, CSharpMapping, PythonMapping, PhpMapping, RubyMapping]:
+ for m in [CppMapping, JavaMapping, CSharpMapping, PythonMapping, PhpMapping, RubyMapping, JavaScriptMixin]:
if isinstance(self.mapping, m):
config = driver.configs[self.mapping]
if "iphone" in config.buildPlatform or config.uwp or config.browser or config.android:
@@ -2387,7 +2388,7 @@ class iOSSimulatorProcessController(RemoteProcessController):
# Pick the last iOS simulator runtime ID in the list of iOS simulators (assumed to be the latest).
try:
for r in run("xcrun simctl list runtimes").split('\n'):
- m = re.search("iOS .* \(.*\) - (.*)", r)
+ m = re.search("iOS .* \\(.*\\) - (.*)", r)
if m:
self.runtimeID = m.group(1)
except: