Skip to content

Commit

Permalink
replace fstrings with format for python 3.4,3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
rtaycher committed Aug 31, 2020
1 parent 8302d8c commit 4a687ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/past/builtins/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ def cmp(x, y):
try:
if isinstance(x, numbers.Number) and math.isnan(x):
if not isinstance(y, numbers.Number):
raise TypeError(f'cannot compare float("nan"), {type(y)} with cmp')
raise TypeError('cannot compare float("nan"), {type_y} with cmp'.format(type_y=type(y)))
if isinstance(y, int):
return 1
else:
return -1
if isinstance(y, numbers.Number) and math.isnan(y):
if not isinstance(x, numbers.Number):
raise TypeError(f'cannot compare {type(x)}, float("nan") with cmp')
raise TypeError('cannot compare {type_x}, float("nan") with cmp'.format(type_x=type(x)))
if isinstance(x, int):
return -1
else:
Expand Down

0 comments on commit 4a687ea

Please sign in to comment.