Skip to content

Commit

Permalink
TST: Add type check to not trigger an invalid FPE within PyPy
Browse files Browse the repository at this point in the history
  • Loading branch information
seberg committed May 4, 2022
1 parent eedffd2 commit a6c07a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions numpy/core/tests/test_casting_floatingpoint_errors.py
Expand Up @@ -59,8 +59,10 @@ def assignment():
yield assignment

# TODO: This constraint is a bug in arr.fill() and should be removed
# e.g. by gh-20924
if value != 10**100:
# e.g. by gh-20924. The type check works around the fact that
# PyPy seems to create an "invalid" error itself, and we see it
# due to gh-21416.
if type(value) is int and value != 10**100:
def fill():
arr = np.empty(3, dtype=dtype)
arr.fill(value)
Expand Down

0 comments on commit a6c07a7

Please sign in to comment.