Show More
@@ -2119,10 +2119,13 b' class InteractiveShell(SingletonConfigurable):' | |||||
2119 | fn = self.find_cell_magic(magic_name) |
|
2119 | fn = self.find_cell_magic(magic_name) | |
2120 | if fn is None: |
|
2120 | if fn is None: | |
2121 | lm = self.find_line_magic(magic_name) |
|
2121 | lm = self.find_line_magic(magic_name) | |
2122 |
etpl = "Cell magic function `%% |
|
2122 | etpl = "Cell magic function `%%{0}` not found{1}." | |
2123 |
extra = '' if lm is None else (' (But line magic `% |
|
2123 | extra = '' if lm is None else (' (But line magic `%{0}` exists, ' | |
2124 |
|
|
2124 | 'did you mean that instead?)'.format(magic_name)) | |
2125 |
error(etpl |
|
2125 | error(etpl.format(magic_name, extra)) | |
|
2126 | elif cell == '': | |||
|
2127 | raise UsageError('%%{0} (with double %) expects code beneath it. ' | |||
|
2128 | 'Did you mean %{0} (single %)?'.format(magic_name)) | |||
2126 | else: |
|
2129 | else: | |
2127 | # Note: this is the distance in the stack to the user's frame. |
|
2130 | # Note: this is the distance in the stack to the user's frame. | |
2128 | # This will need to be updated if the internal calling logic gets |
|
2131 | # This will need to be updated if the internal calling logic gets |
@@ -776,6 +776,7 b' python-profiler package from non-free.""")' | |||||
776 | posix=False, strict=False) |
|
776 | posix=False, strict=False) | |
777 | if stmt == "" and cell is None: |
|
777 | if stmt == "" and cell is None: | |
778 | return |
|
778 | return | |
|
779 | ||||
779 | timefunc = timeit.default_timer |
|
780 | timefunc = timeit.default_timer | |
780 | number = int(getattr(opts, "n", 0)) |
|
781 | number = int(getattr(opts, "n", 0)) | |
781 | repeat = int(getattr(opts, "r", timeit.default_repeat)) |
|
782 | repeat = int(getattr(opts, "r", timeit.default_repeat)) |
@@ -36,6 +36,7 b' from IPython.utils.openpy import source_to_unicode' | |||||
36 | from IPython.utils.path import unquote_filename |
|
36 | from IPython.utils.path import unquote_filename | |
37 | from IPython.utils.process import abbrev_cwd |
|
37 | from IPython.utils.process import abbrev_cwd | |
38 | from IPython.utils.terminal import set_term_title |
|
38 | from IPython.utils.terminal import set_term_title | |
|
39 | ||||
39 | #----------------------------------------------------------------------------- |
|
40 | #----------------------------------------------------------------------------- | |
40 | # Magic implementation classes |
|
41 | # Magic implementation classes | |
41 | #----------------------------------------------------------------------------- |
|
42 | #----------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now