File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
galleries/examples/widgets
lib/matplotlib/backends/qt_editor Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def submit(expression):
32
32
*expression* is a string using "t" as its independent variable, e.g.
33
33
"t ** 3".
34
34
"""
35
- ydata = eval (expression )
35
+ ydata = eval (expression , { 'np' : np }, { 't' : t } )
36
36
l .set_ydata (ydata )
37
37
ax .relim ()
38
38
ax .autoscale_view ()
Original file line number Diff line number Diff line change 41
41
__version__ = '1.0.10'
42
42
__license__ = __doc__
43
43
44
+ from ast import literal_eval
45
+
44
46
import copy
45
47
import datetime
46
48
import logging
@@ -351,7 +353,7 @@ def get(self):
351
353
else :
352
354
value = date_ .toPython ()
353
355
else :
354
- value = eval (str (field .text ()))
356
+ value = literal_eval (str (field .text ()))
355
357
valuelist .append (value )
356
358
return valuelist
357
359
You can’t perform that action at this time.
0 commit comments