diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index 9af13028486..bb6e8ba299d 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -37,7 +37,7 @@ def placeCursorToLine(editor, line, isRegex=False):
return waitForObject(editor)
isDarwin = platform.system() == 'Darwin'
- if not isinstance(editor, (str, unicode)):
+ if not isString(editor):
editor = objectMap.realName(editor)
oldPosition = 0
jumpToFirstLine(getEditor())
@@ -120,7 +120,7 @@ def replaceEditorContent(editor, newcontent):
type(editor, newcontent)
def typeLines(editor, lines):
- if isinstance(lines, (str, unicode)):
+ if isString(lines):
lines = [lines]
if isinstance(lines, (list, tuple)):
for line in lines:
diff --git a/tests/system/shared/fs_utils.py b/tests/system/shared/fs_utils.py
index f36fbd7fbf2..ee24d6f0ca3 100644
--- a/tests/system/shared/fs_utils.py
+++ b/tests/system/shared/fs_utils.py
@@ -35,10 +35,10 @@ def changeFilePermissions(dirPath, readPerm, writePerm, excludeFileNames=None):
permission |= stat.S_IWRITE
if excludeFileNames == None:
excludeFileNames = []
- elif isinstance(excludeFileNames, (str, unicode)):
+ elif isString(excludeFileNames):
excludeFileNames = [excludeFileNames]
if not isinstance(excludeFileNames, (tuple, list)):
- test.warning("File names to exclude must be of type str, unicode, list, tuple or None - "
+ test.warning("File names to exclude must be of type str, list, tuple or None - "
"ignoring parameter this time.")
excludeFileNames = []
if not os.path.isdir(dirPath):
diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index 587574ff0a5..a4abeb7a723 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -95,8 +95,8 @@ def setRunInTerminal(wantedKit, runInTerminal=True):
switchViewTo(ViewConstants.EDIT)
def __getTargetFromToolTip__(toolTip):
- if toolTip == None or not isinstance(toolTip, (str, unicode)):
- test.warning("Parameter toolTip must be of type str or unicode and can't be None!")
+ if toolTip == None or not isString(toolTip):
+ test.warning("Parameter toolTip must be of type str and can't be None!")
return None
pattern = re.compile(".*Kit:(.*)Deploy.*")
target = pattern.match(toolTip)
@@ -108,7 +108,7 @@ def __getTargetFromToolTip__(toolTip):
def getExecutableAndTargetFromToolTip(toolTip):
target = __getTargetFromToolTip__(toolTip)
- if toolTip == None or not isinstance(toolTip, (str, unicode)):
+ if toolTip == None or not isString(toolTip):
return None, target
pattern = re.compile('.*Run:(.*) 2:
+ return isinstance(sth, str)
+ else:
+ return isinstance(sth, (str, unicode))
diff --git a/tests/system/suite_general/tst_default_settings/test.py b/tests/system/suite_general/tst_default_settings/test.py
index 2cb40725b82..29c65425b09 100644
--- a/tests/system/suite_general/tst_default_settings/test.py
+++ b/tests/system/suite_general/tst_default_settings/test.py
@@ -306,7 +306,7 @@ def __compareCompilers__(foundCompilers, expectedCompilers):
if isinstance(currentFound, dict):
foundExp = False
for currentExp in expectedCompilers:
- if isinstance(currentExp, (str, unicode)):
+ if isString(currentExp):
continue
key = currentExp.keys()[0]
# special case for (fuzzy) regex comparison on Windows (internal LLVM)
@@ -353,7 +353,7 @@ def __compareDebuggers__(foundDebuggers, expectedDebuggers):
def __lowerStrs__(iterable):
for it in iterable:
- if isinstance(it, (str, unicode)):
+ if isString(it):
yield it.lower()
else:
yield it