Show More
@@ -791,9 +791,6 b' class MaybeAsyncCommandCompiler(CommandCompiler):' | |||
|
791 | 791 | self.compiler = MaybeAsyncCompile(extra_flags=extra_flags) |
|
792 | 792 | |
|
793 | 793 | |
|
794 | if (sys.version_info.major, sys.version_info.minor) >= (3, 8): | |
|
795 | _extra_flags = ast.PyCF_ALLOW_TOP_LEVEL_AWAIT | |
|
796 | else: | |
|
797 | _extra_flags = ast.PyCF_ONLY_AST | |
|
794 | _extra_flags = ast.PyCF_ALLOW_TOP_LEVEL_AWAIT | |
|
798 | 795 | |
|
799 | 796 | compile_command = MaybeAsyncCommandCompiler(extra_flags=_extra_flags) |
@@ -8,49 +8,44 b'' | |||
|
8 | 8 | import ast |
|
9 | 9 | import bdb |
|
10 | 10 | import builtins as builtin_mod |
|
11 | import cProfile as profile | |
|
11 | 12 | import gc |
|
12 | 13 | import itertools |
|
14 | import math | |
|
13 | 15 | import os |
|
16 | import pstats | |
|
17 | import re | |
|
14 | 18 | import shlex |
|
15 | 19 | import sys |
|
16 | 20 | import time |
|
17 | 21 | import timeit |
|
18 | import math | |
|
19 | import re | |
|
22 | from ast import Module | |
|
23 | from io import StringIO | |
|
24 | from logging import error | |
|
25 | from pathlib import Path | |
|
20 | 26 | from pdb import Restart |
|
27 | from warnings import warn | |
|
21 | 28 | |
|
22 | import cProfile as profile | |
|
23 | import pstats | |
|
24 | ||
|
25 | from IPython.core import oinspect | |
|
26 | from IPython.core import magic_arguments | |
|
27 | from IPython.core import page | |
|
29 | from IPython.core import magic_arguments, oinspect, page | |
|
28 | 30 | from IPython.core.error import UsageError |
|
29 | 31 | from IPython.core.macro import Macro |
|
30 | from IPython.core.magic import (Magics, magics_class, line_magic, cell_magic, | |
|
31 | line_cell_magic, on_off, needs_local_scope, | |
|
32 | no_var_expand) | |
|
32 | from IPython.core.magic import ( | |
|
33 | Magics, | |
|
34 | cell_magic, | |
|
35 | line_cell_magic, | |
|
36 | line_magic, | |
|
37 | magics_class, | |
|
38 | needs_local_scope, | |
|
39 | no_var_expand, | |
|
40 | on_off, | |
|
41 | ) | |
|
33 | 42 | from IPython.testing.skipdoctest import skip_doctest |
|
34 | from IPython.utils.contexts import preserve_keys | |
|
35 | 43 | from IPython.utils.capture import capture_output |
|
44 | from IPython.utils.contexts import preserve_keys | |
|
36 | 45 | from IPython.utils.ipstruct import Struct |
|
37 | 46 | from IPython.utils.module_paths import find_mod |
|
38 | 47 | from IPython.utils.path import get_py_filename, shellglob |
|
39 | 48 | from IPython.utils.timing import clock, clock2 |
|
40 | from warnings import warn | |
|
41 | from logging import error | |
|
42 | from pathlib import Path | |
|
43 | from io import StringIO | |
|
44 | from pathlib import Path | |
|
45 | ||
|
46 | if sys.version_info > (3,8): | |
|
47 | from ast import Module | |
|
48 | else : | |
|
49 | # mock the new API, ignore second argument | |
|
50 | # see https://github.com/ipython/ipython/issues/11590 | |
|
51 | from ast import Module as OriginalModule | |
|
52 | Module = lambda nodelist, type_ignores: OriginalModule(nodelist) | |
|
53 | ||
|
54 | 49 | |
|
55 | 50 | #----------------------------------------------------------------------------- |
|
56 | 51 | # Magic implementation classes |
@@ -1308,12 +1308,7 b' def test_time_no_var_expand():' | |||
|
1308 | 1308 | # this is slow, put at the end for local testing. |
|
1309 | 1309 | def test_timeit_arguments(): |
|
1310 | 1310 | "Test valid timeit arguments, should not cause SyntaxError (GH #1269)" |
|
1311 | if sys.version_info < (3,7): | |
|
1312 | _ip.magic("timeit -n1 -r1 ('#')") | |
|
1313 | else: | |
|
1314 | # 3.7 optimize no-op statement like above out, and complain there is | |
|
1315 | # nothing in the for loop. | |
|
1316 | _ip.magic("timeit -n1 -r1 a=('#')") | |
|
1311 | _ip.magic("timeit -n1 -r1 a=('#')") | |
|
1317 | 1312 | |
|
1318 | 1313 | |
|
1319 | 1314 | TEST_MODULE = """ |
General Comments 0
You need to be logged in to leave comments.
Login now