SquishTests: Further Python3 adaption

Fixing tests in suite_editors

Change-Id: I4e5e1adc2c4e6606232d76a794aff7a7144d5c9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2023-04-28 17:29:34 +02:00
parent fac2e3c548
commit d86b091297
4 changed files with 10 additions and 4 deletions
+7 -2
View File
@@ -513,8 +513,13 @@ def progressBarWait(timeout=60000, warn=True):
checkIfObjectExists(":Qt Creator_Core::Internal::ProgressBar", False, timeout)
def readFile(filename):
with open(filename, "r") as f:
return f.read()
try:
with open(filename, "r") as f:
return f.read()
except:
# Read file as binary
with open(filename, "rb") as f:
return f.read()
def simpleFileName(navigatorFileName):
# try to find the last part of the given name, assume it's inside a (folder) structure