tests/test_pyfiles.py
changeset 3326 ce725978d11c
parent 3075 5175c093a0dd
child 3617 ae5744e97c42
--- a/tests/test_pyfiles.py	Sat Feb 06 09:24:08 2010 +0000
+++ b/tests/test_pyfiles.py	Mon Feb 08 18:17:33 2010 +0000
@@ -18,9 +18,9 @@
         return seq
 
     # Make a sorted copy of the input sequence.
+    cnvt = isinstance(seq,basestring)
     seq2 = seq[:]
-    if type(seq2) == type(''):
-        seq2 = map(None, seq2)
+    if cnvt: seq2 = list(seq2)
     seq2.sort()
 
     # Remove adjacent elements if they are identical.
@@ -32,11 +32,11 @@
                 del seq2[i+1]
         except IndexError:
             pass
-        i = i + 1
+        i += 1
 
     # Try to return something of the same type as the input.
-    if type(seq) == type(''):
-        return string.join(seq2, '')
+    if cnvt:
+        return seq[0:0].join(seq2)
     else:
         return seq2