##// END OF EJS Templates
Shortcut to transform_cell in magics code
Thomas Kluyver -
Show More
@@ -297,7 +297,7 b' python-profiler package from non-free.""")'
297 297 list_all=True, posix=False)
298 298 if cell is not None:
299 299 arg_str += '\n' + cell
300 arg_str = self.shell.input_transformer_manager.transform_cell(arg_str)
300 arg_str = self.shell.transform_cell(arg_str)
301 301 return self._run_with_profiler(arg_str, opts, self.shell.user_ns)
302 302
303 303 def _run_with_profiler(self, code, opts, namespace):
@@ -1032,7 +1032,7 b' python-profiler package from non-free.""")'
1032 1032 # this code has tight coupling to the inner workings of timeit.Timer,
1033 1033 # but is there a better way to achieve that the code stmt has access
1034 1034 # to the shell namespace?
1035 transform = self.shell.input_transformer_manager.transform_cell
1035 transform = self.shell.transform_cell
1036 1036
1037 1037 if cell is None:
1038 1038 # called as line magic
@@ -1190,9 +1190,9 b' python-profiler package from non-free.""")'
1190 1190 raise UsageError("Can't use statement directly after '%%time'!")
1191 1191
1192 1192 if cell:
1193 expr = self.shell.input_transformer_manager.transform_cell(cell)
1193 expr = self.shell.transform_cell(cell)
1194 1194 else:
1195 expr = self.shell.input_transformer_manager.transform_cell(line)
1195 expr = self.shell.transform_cell(line)
1196 1196
1197 1197 # Minimum time above which parse time will be reported
1198 1198 tp_min = 0.1
General Comments 0
You need to be logged in to leave comments. Login now