From 4c35a853c2a09de5bdb236aa6bd97aa5ea18f195 Mon Sep 17 00:00:00 2001 From: kritisingh1 Date: Wed, 3 Apr 2019 22:55:50 +0530 Subject: Issue deprecation warnings --- numpy/lib/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy/lib/utils.py') 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) -- cgit v1.2.1