[llvm] r313427 - [lit] Better check for integral value.
Zachary Turner via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 15 17:38:20 PDT 2017
Author: zturner
Date: Fri Sep 15 17:38:20 2017
New Revision: 313427
URL: http://llvm.org/viewvc/llvm-project?rev=313427&view=rev
Log:
[lit] Better check for integral value.
Some versions of python don't have 'long'. Use numbers.Number
instead.
Modified:
llvm/trunk/utils/lit/lit/util.py
Modified: llvm/trunk/utils/lit/lit/util.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/util.py?rev=313427&r1=313426&r2=313427&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/util.py (original)
+++ llvm/trunk/utils/lit/lit/util.py Fri Sep 15 17:38:20 2017
@@ -1,6 +1,7 @@
import errno
import itertools
import math
+import numbers
import os
import platform
import signal
@@ -14,7 +15,7 @@ def pythonize_bool(value):
return False
if type(value) is bool:
return value
- if isinstance(value, (int, long)):
+ if isinstance(value, numbers.Number):
return value != 0
if isinstance(value, basestring):
if value.lower() in ('1', 'true', 'on', 'yes'):
More information about the llvm-commits
mailing list