-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: fix wrong error checks of PyBytes_AsStringAndSize #5088
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
Conversation
rebased for backport |
Certainly not wrong, but the |
its not wrong with current python, but the function is documented to return -1 not negative. As this type of error handling is so common its pretty much impossible python could change that but as I fixed one of them that was wrong my OCD forced me to fix all :) |
currently numpy is half == -1 and half < 0, we alternatively could change all to < 0, that would make me happy too ;) |
OCD is a common trait in programmers. It is a good thing :) I kind of like the |
5df6ac7
to
2f74fce
Compare
The check in ufunc_type_resolution.c is broken due to a spurious not and a few cases of TypeError being overwritten without clearing. Also change all of these error checks to a negative check for consistency.
2f74fce
to
e50e17c
Compare
changed all to < 0 |
BUG: fix wrong error checks of PyBytes_AsStringAndSize
Looks good, thanks Julian. |
BUG: fix wrong error checks of PyBytes_AsStringAndSize
The check in ufunc_type_resolution.c is broken due to a spurious not and
a few cases of TypeError being overwritten without clearing.
Also change all of these error checks to a negative check for
consistency.