Skip to content

Commit

Permalink
Add deprecations for numpy 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eendebakpt committed Oct 1, 2023
1 parent ecfcbeb commit 53aaacc
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 53aaacc

Please sign in to comment.