Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e306c9d

Browse files
committed
Update old deprecation
1 parent 8276c7a commit e306c9d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

IPython/core/interactiveshell.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2287,7 +2287,11 @@ def find_magic(self, magic_name, magic_kind='line'):
22872287
return self.magics_manager.magics[magic_kind].get(magic_name)
22882288

22892289
def magic(self, arg_s):
2290-
"""DEPRECATED. Use run_line_magic() instead.
2290+
"""
2291+
DEPRECATED
2292+
2293+
Deprecated since IPython 0.13 (warning added in
2294+
8.1), use run_line_magic(magic_name, parameter_s).
22912295
22922296
Call a magic function by name.
22932297
@@ -2305,6 +2309,12 @@ def magic(self, arg_s):
23052309
valid Python code you can type at the interpreter, including loops and
23062310
compound statements.
23072311
"""
2312+
warnings.warn(
2313+
"`magic(...)` is deprecated since IPython 0.13 (warning added in "
2314+
"8.1), use run_line_magic(magic_name, parameter_s).",
2315+
DeprecationWarning,
2316+
stacklevel=2,
2317+
)
23082318
# TODO: should we issue a loud deprecation warning here?
23092319
magic_name, _, magic_arg_s = arg_s.partition(' ')
23102320
magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)

0 commit comments

Comments
 (0)