Commit 084fbbde by Toshio Kuratomi

Reverse the conditional so there's one less return from this function

parent d0f8df4b
...@@ -55,10 +55,9 @@ class InventoryParser(object): ...@@ -55,10 +55,9 @@ class InventoryParser(object):
if "#" not in v: if "#" not in v:
try: try:
ret = ast.literal_eval(v) ret = ast.literal_eval(v)
if type(ret) == float: if not isinstance(ret, float):
# Do not trim floats. Eg: "1.20" to 1.2 # Do not trim floats. Eg: "1.20" to 1.2
return v return ret
return ret
# Using explicit exceptions. # Using explicit exceptions.
# Likely a string that literal_eval does not like. We wil then just set it. # Likely a string that literal_eval does not like. We wil then just set it.
except ValueError: except ValueError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment