Skip to content

BUG: fixed conflict with python2.4 due to calling PyErr_WarnEx() in conversion_utils.c #88

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

Closed
wants to merge 4 commits into from

Conversation

dhomeier
Copy link
Contributor

import numpy failed; need to use PyErr_Warn() for version<2.5, which is now handled with DEPRECATE macro

@dhomeier
Copy link
Contributor Author

Thanks, that's useful! There are 3 other instances of this in the multiarray sources, so it's probably best to change them all to the macro so no others will learn from bad examples ;-)

@dhomeier
Copy link
Contributor Author

OK, actually none of the others is called with PyExc_DeprecationWarning... In fact the present case specifies a stacklevel of 0 rather than 1, so it's not exactly equivalent to DEPRECATE(msg) (nor the PyErr_Warn() case) either. Not sure if that's an issue - it's not clear to me what a stacklevel of 0 means in this case.

@mwiebe
Copy link
Member

mwiebe commented Jun 16, 2011

FWIW that stuff wasn't entirely clear to me either when I wrote it. I figured stack level 0 was what you would want, because the C function call doesn't count as a stack level, so going deeper would just be throwing away useful information.

@dhomeier
Copy link
Contributor Author

Meaning, I guess, e.g. this warning
/lib/python2.4/site-packages/numpy/core/records.py:157: DeprecationWarning: DType strings 'O4' and 'O8' are deprecated because they are platform specific. Use 'O' instead dtype = sb.dtype(formats, aligned)
would be raised from within the dtype code instead of records.py - the above with stack level 1 also seems sensible enough to me, though.

@mwiebe
Copy link
Member

mwiebe commented Jun 16, 2011

Yeah, that message looks fine to me.

@dhomeier
Copy link
Contributor Author

I'll go ahead then and use DEPRECATE().

@dhomeier
Copy link
Contributor Author

I agree, it does (silly attempt to save a variable).

@charris
Copy link
Member

charris commented Jun 16, 2011

That's the compiler's job ;)

@charris
Copy link
Member

charris commented Jun 16, 2011

I moved the trailing comment down a line, removed a trailing space, and squashed the commits together before committing as 5cb956e. Thanks for the fix.

@charris charris closed this Jun 16, 2011
fangerer pushed a commit to hpyproject/numpy-hpy that referenced this pull request Dec 12, 2022
Merge in ~STEPAN.SINDELAR_ORACLE.COM/numpy-hpy from mq/GR-40827 to labs-hpy-port

* commit '902ce0f25458d3b7075f2fbc9cb8222c902d3a88':
  address comments and other few fixes
  address comments
  fix bugs
  Port "_get_sfloat_dtype" to HPy
  fix bug
  remove hpy abort
  fix bug
  fix bug
  fix memory leak issue
luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants