|
| 1 | +from __future__ import absolute_import |
1 | 2 | import sys |
2 | 3 | import traceback |
3 | 4 | import collections |
4 | | -from utils import Eval, latexify, arguments, removeSymPy, \ |
| 5 | +from .utils import Eval, latexify, arguments, removeSymPy, \ |
5 | 6 | custom_implicit_transformation, synonyms, OTHER_SYMPY_FUNCTIONS, \ |
6 | 7 | close_matches |
7 | | -from resultsets import find_result_set, get_card, format_by_type, \ |
| 8 | +from .resultsets import find_result_set, get_card, format_by_type, \ |
8 | 9 | is_function_handled, find_learn_more_set |
9 | 10 | from sympy import latex, series, sympify, solve, Derivative, \ |
10 | 11 | Integral, Symbol, diff, integrate |
11 | 12 | import sympy |
12 | 13 | from sympy.core.function import FunctionClass |
13 | 14 | from sympy.parsing.sympy_parser import stringify_expr, eval_expr, \ |
14 | 15 | standard_transformations, convert_xor, TokenError |
| 16 | +from six.moves import map |
15 | 17 |
|
16 | 18 | PREEXEC = """from __future__ import division |
17 | 19 | from sympy import * |
@@ -115,7 +117,7 @@ def disambiguate(self, arguments): |
115 | 117 |
|
116 | 118 | def eval_input(self, s): |
117 | 119 | namespace = {} |
118 | | - exec PREEXEC in {}, namespace |
| 120 | + exec(PREEXEC, {}, namespace) |
119 | 121 |
|
120 | 122 | def plot(f=None, **kwargs): |
121 | 123 | """Plot functions. Not the same as SymPy's plot. |
@@ -222,7 +224,7 @@ def prepare_cards(self, parsed, arguments, evaluator, evaluated): |
222 | 224 | if any(get_card(c).is_multivariate() for c in cards): |
223 | 225 | result[-1].update({ |
224 | 226 | "num_variables": len(components['variables']), |
225 | | - "variables": map(repr, components['variables']), |
| 227 | + "variables": list(map(repr, components['variables'])), |
226 | 228 | "variable": repr(components['variable']) |
227 | 229 | }) |
228 | 230 |
|
|
0 commit comments