summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/lit')
-rw-r--r--llvm/utils/lit/lit/TestRunner.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 5eecb80e2f3..bfd15961ba0 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -845,8 +845,14 @@ def _executeShCmd(cmd, shenv, results, timeoutHelper):
# Replace uses of /dev/null with temporary files.
if kAvoidDevNull:
+ # In Python 2.x, basestring is the base class for all string (including unicode)
+ # In Python 3.x, basestring no longer exist and str is always unicode
+ try:
+ str_type = basestring
+ except NameError:
+ str_type = str
for i,arg in enumerate(args):
- if isinstance(arg, basestring) and kDevNull in arg:
+ if isinstance(arg, str_type) and kDevNull in arg:
f = tempfile.NamedTemporaryFile(delete=False)
f.close()
named_temp_files.append(f.name)
OpenPOWER on IntegriCloud