[New-bugs-announce] [issue24631] Regression in timeit with multyline setup

Serhiy Storchaka report at bugs.python.org
Tue Jul 14 07:10:51 CEST 2015

New submission from Serhiy Storchaka:

Issue5633 introduced a regression in 3.5.

$ ./python -m timeit -s "a = 1" -s "b = 2"
Traceback (most recent call last):
  File "/home/serhiy/py/cpython-3.5/Lib/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/serhiy/py/cpython-3.5/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/serhiy/py/cpython-3.5/Lib/timeit.py", line 338, in <module>
  File "/home/serhiy/py/cpython-3.5/Lib/timeit.py", line 296, in main
    t = Timer(stmt, setup, timer)
  File "/home/serhiy/py/cpython-3.5/Lib/timeit.py", line 122, in __init__
    compile(setup + '\n' + stmt, dummy_src_name, "exec")
  File "<timeit-src>", line 2
    b = 2
IndentationError: unexpected indent

Proposed patch fixes it.

assignee: serhiy.storchaka
components: Library (Lib)
messages: 246717
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Regression in timeit with multyline setup
type: behavior
versions: Python 3.5, Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list