Squish: Introduce helper function for checking for strings

In Python3 type unicode is unavailable since it's implicit with "str".
The new functions helps porting code.

Change-Id: I5de0fa182acbbaf267ed51f66f658cb9c884f4c5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2021-10-29 14:38:35 +02:00
parent 4980f71dd5
commit 7a8ca55f77
5 changed files with 23 additions and 16 deletions
+2 -2
View File
@@ -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: