From 7a8ca55f77b62017c011b2cb8b9ac7bf50be7daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20L=C3=B6hning?= Date: Fri, 29 Oct 2021 14:38:35 +0200 Subject: 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 --- tests/system/shared/fs_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/system/shared/fs_utils.py') diff --git a/tests/system/shared/fs_utils.py b/tests/system/shared/fs_utils.py index f36fbd7fbf..ee24d6f0ca 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): -- cgit v1.2.1