Skip to content

Commit

Permalink
fix(token): Need to convert self to a plain string before int or floa…
Browse files Browse the repository at this point in the history
…t conversion, otherwise python38 correctly complains about a race condition.
  • Loading branch information
rbeyer committed Jun 1, 2021
1 parent ba67e20 commit 3fd375c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pvl/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __index__(self):
try:
return self.decoder.decode_non_decimal(str(self))
except ValueError:
if int(self) == float(self):
return int(self)
if int(str(self)) == float(str(self)):
return int(str(self))

raise ValueError(f"The {self:r} cannot be used as an index.")

Expand Down

0 comments on commit 3fd375c

Please sign in to comment.