OSDN Git Service

Squish: Use isinstance() instead of comparing classnames
authorRobert Loehning <robert.loehning@nokia.com>
Mon, 17 Oct 2011 17:09:51 +0000 (19:09 +0200)
committerRobert Löhning <robert.loehning@nokia.com>
Tue, 18 Oct 2011 08:40:27 +0000 (10:40 +0200)
Change-Id: Ia0683902e96f1dc175978bdbb13fbd114f6ad739
Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
tests/system/shared/utils.py

index 6f7e59e..98e1b05 100644 (file)
@@ -103,9 +103,9 @@ def prepareForSignal(object, signal):
 def cleanUpUserFiles(pathsToProFiles=None):
     if pathsToProFiles==None:
         return False
-    if className(pathsToProFiles) in ("str", "unicode"):
+    if isinstance(pathsToProFiles, (str, unicode)):
         filelist = glob.glob(pathsToProFiles+".user*")
-    elif className(pathsToProFiles)=="list":
+    elif isinstance(pathsToProFiles, (list, tuple)):
         filelist = []
         for p in pathsToProFiles:
             filelist.extend(glob.glob(p+".user*"))