Skip to content

Commit 486d7ae

Browse files
committed
Fixed type checking in itertools.repeat()
1 parent 13f0323 commit 486d7ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/lib-graalpython/itertools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ class repeat():
2929
def __init__(self, obj, times=None):
3030
self.obj = obj
3131
self.times = times
32-
if not isinstance(times, int):
33-
raise TypeError("integer argument expected, got float")
32+
if times is not None and not isinstance(times, int):
33+
raise TypeError(f"integer argument expected, got {times.__class__.__name__}")
3434
self.count = times if times and times > 0 else 0
3535

3636
@__graalpython__.builtin_method

0 commit comments

Comments
 (0)