Skip to content

Commit

Permalink
Merge pull request #122 from eendebakpt/np2
Browse files Browse the repository at this point in the history
Add deprecations for numpy 2.0
  • Loading branch information
newville authored Oct 2, 2023
2 parents ecfcbeb + 53aaacc commit ee20b97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions asteval/astutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
# aliases deprecated in NumPy v1.24.0
numpy_deprecated += ['int0', 'uint0', 'bool8']

if int(numpy_version[0]) >= 2 :
# aliases deprecated in NumPy v2.0
numpy_deprecated += ['bool', 'chararray', 'long', 'str']

FROM_NUMPY = tuple(set(FROM_NUMPY) - set(numpy_deprecated))

FROM_NUMPY = tuple(sym for sym in FROM_NUMPY if hasattr(numpy, sym))
Expand Down

0 comments on commit ee20b97

Please sign in to comment.