diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py index 0d036e1..c2d3b01 100644 --- a/IPython/core/magics/execution.py +++ b/IPython/core/magics/execution.py @@ -110,7 +110,6 @@ class TimeitResult(object): p.text(u'') - class TimeitTemplateFiller(ast.NodeTransformer): """Fill in the AST template for timing execution. diff --git a/IPython/core/tests/test_magic.py b/IPython/core/tests/test_magic.py index 5225ec3..a5114fd 100644 --- a/IPython/core/tests/test_magic.py +++ b/IPython/core/tests/test_magic.py @@ -568,7 +568,13 @@ def test_timeit_shlex(): def test_timeit_arguments(): "Test valid timeit arguments, should not cause SyntaxError (GH #1269)" - _ip.magic("timeit ('#')") + if sys.version_info < (3,7): + _ip.magic("timeit ('#')") + else: + # 3.7 optimize no-op statement like above out, and complain there is + # nothing in the for loop. + _ip.magic("timeit a=('#')") + def test_timeit_special_syntax():