##// END OF EJS Templates
Allow %/%%timeit to process IPython syntax....
Fernando Perez -
Show More
@@ -767,14 +767,14 b' python-profiler package from non-free.""")'
767 # this code has tight coupling to the inner workings of timeit.Timer,
767 # this code has tight coupling to the inner workings of timeit.Timer,
768 # but is there a better way to achieve that the code stmt has access
768 # but is there a better way to achieve that the code stmt has access
769 # to the shell namespace?
769 # to the shell namespace?
770
770 transform = self.shell.input_splitter.transform_cell
771 if cell is None:
771 if cell is None:
772 # called as line magic
772 # called as line magic
773 setup = 'pass'
773 setup = 'pass'
774 stmt = timeit.reindent(stmt, 8)
774 stmt = timeit.reindent(transform(stmt), 8)
775 else:
775 else:
776 setup = timeit.reindent(stmt, 4)
776 setup = timeit.reindent(transform(stmt), 4)
777 stmt = timeit.reindent(cell, 8)
777 stmt = timeit.reindent(transform(cell), 8)
778
778
779 # From Python 3.3, this template uses new-style string formatting.
779 # From Python 3.3, this template uses new-style string formatting.
780 if sys.version_info >= (3, 3):
780 if sys.version_info >= (3, 3):
General Comments 0
You need to be logged in to leave comments. Login now