-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading error type in draw.circle
#2404
Comments
yunline
changed the title
Aug 17, 2023
pg_IntFromObj
ignores overflow errorpg_IntFromObj
ignores OverflowError
yunline
changed the title
Misleading error type in Aug 17, 2023
pg_IntFromObj
ignores OverflowErrordraw.circle
Actually, no matter what type of exception is raised inside, it always returns import pygame
class Foo:
def __index__(self):
#return 114514
raise NameError("Foo is not a good name.")
sf = pygame.Surface((100,100))
# Expected behavior: raises a NameError
pygame.draw.circle(sf, "red", (0,0), Foo()) Traceback (most recent call last):
File "x:\python\pygame_test\pgint.py", line 11, in <module>
pygame.draw.circle(sf, "red", (0,0), Foo())
TypeError: radius argument must be a number |
When the input is a float, the function doesn't raise any error even if the value is way larger than pygame.draw.circle(sf, "red", (0,0), 1e40)
|
I'm trying to fix this. |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should raise an
OverflowError
here.The text was updated successfully, but these errors were encountered: