Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork11.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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
juliantaylor commentedSep 19, 2014
rebased for backport |
charris commentedSep 19, 2014
Certainly not wrong, but the |
juliantaylor commentedSep 19, 2014
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 :) |
juliantaylor commentedSep 19, 2014
currently numpy is half == -1 and half < 0, we alternatively could change all to < 0, that would make me happy too ;) |
charris commentedSep 19, 2014
OCD is a common trait in programmers. It is a good thing :) I kind of like the |
The check in ufunc_type_resolution.c is broken due to a spurious not anda few cases of TypeError being overwritten without clearing.Also change all of these error checks to a negative check forconsistency.
juliantaylor commentedSep 19, 2014
changed all to < 0 |
BUG: fix wrong error checks of PyBytes_AsStringAndSize
charris commentedSep 19, 2014
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.