summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 718b55c4b..188a99d92 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -1098,6 +1098,9 @@ def safe_eval(source):
Evaluate a string containing a Python literal expression without
allowing the execution of arbitrary non-literal code.
+ .. deprecate:: 1.17
+ safe_eval is deprecated
+
Parameters
----------
source : str
@@ -1137,6 +1140,9 @@ def safe_eval(source):
# Local import to speed up numpy's import time.
import ast
+ # Numpy 1.17
+ warnings.warn("SafeEval is deprecated in 1.17",
+ DeprecationWarning, stacklevel=2)
return ast.literal_eval(source)