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>
    sys.exit(main())
  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 <rep...@bugs.python.org>
<http://bugs.python.org/issue24631>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to