|
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 |
|
0 commit comments