mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-18 18:42:46 +02:00
lit: python3 compatibility fix
llvm-svn: 265070
This commit is contained in:
parent
9d806ba01a
commit
10c7f27ee3
@ -102,11 +102,18 @@ class JSONMetricValue(MetricValue):
|
||||
def toMetricValue(value):
|
||||
if isinstance(value, MetricValue):
|
||||
return value
|
||||
elif isinstance(value, int) or isinstance(value, long):
|
||||
elif isinstance(value, int):
|
||||
return IntMetricValue(value)
|
||||
elif isinstance(value, float):
|
||||
return RealMetricValue(value)
|
||||
else:
|
||||
# 'long' is only present in python2
|
||||
try:
|
||||
if isinstance(value, long):
|
||||
return IntMetricValue(value)
|
||||
except NameError:
|
||||
pass
|
||||
|
||||
# Try to create a JSONMetricValue and let the constructor throw
|
||||
# if value is not a valid type.
|
||||
return JSONMetricValue(value)
|
||||
|
Loading…
Reference in New Issue
Block a user