Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in timeit with multyline setup #68819

Closed
serhiy-storchaka opened this issue Jul 14, 2015 · 5 comments
Closed

Regression in timeit with multyline setup #68819

serhiy-storchaka opened this issue Jul 14, 2015 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 24631
Nosy @brettcannon, @serhiy-storchaka
Files
  • timeit_multiline_setup.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2015-07-15.19:13:13.640>
    created_at = <Date 2015-07-14.05:10:51.215>
    labels = ['type-bug', 'library']
    title = 'Regression in timeit with multyline setup'
    updated_at = <Date 2015-07-15.19:13:13.639>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-07-15.19:13:13.639>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-07-15.19:13:13.640>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-07-14.05:10:51.215>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['39925']
    hgrepos = []
    issue_num = 24631
    keywords = ['patch']
    message_count = 5.0
    messages = ['246717', '246735', '246736', '246770', '246774']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24631'
    versions = ['Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    bpo-5633 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.

    @serhiy-storchaka serhiy-storchaka self-assigned this Jul 14, 2015
    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 14, 2015
    @brettcannon
    Copy link
    Member

    There's no patch to review.

    @serhiy-storchaka
    Copy link
    Member Author

    Oh, sorry. Here is it.

    @brettcannon
    Copy link
    Member

    Patch LGTM

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 15, 2015

    New changeset fce682a493e7 by Serhiy Storchaka in branch '3.5':
    Issue bpo-24631: Fixed regression in the timeit modulu with multyline setup.
    https://hg.python.org/cpython/rev/fce682a493e7

    New changeset 0b04e5689c33 by Serhiy Storchaka in branch 'default':
    Issue bpo-24631: Fixed regression in the timeit modulu with multyline setup.
    https://hg.python.org/cpython/rev/0b04e5689c33

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants