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

test_idle fails under -OO #68013

Closed
brettcannon opened this issue Mar 31, 2015 · 4 comments
Closed

test_idle fails under -OO #68013

brettcannon opened this issue Mar 31, 2015 · 4 comments
Assignees

Comments

@brettcannon
Copy link
Member

BPO 23825
Nosy @brettcannon, @terryjreedy, @serhiy-storchaka
Files
  • issue23825.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-04-04.06:54:05.768>
    created_at = <Date 2015-03-31.14:29:03.752>
    labels = ['expert-IDLE']
    title = 'test_idle fails under -OO'
    updated_at = <Date 2015-04-04.06:54:05.767>
    user = 'https://github.com/brettcannon'

    bugs.python.org fields:

    activity = <Date 2015-04-04.06:54:05.767>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-04-04.06:54:05.768>
    closer = 'serhiy.storchaka'
    components = ['IDLE']
    creation = <Date 2015-03-31.14:29:03.752>
    creator = 'brett.cannon'
    dependencies = []
    files = ['38762']
    hgrepos = []
    issue_num = 23825
    keywords = ['patch']
    message_count = 4.0
    messages = ['239726', '240039', '240040', '240046']
    nosy_count = 4.0
    nosy_names = ['brett.cannon', 'terry.reedy', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue23825'
    versions = ['Python 3.4', 'Python 3.5']

    @serhiy-storchaka
    Copy link
    Member

    Here is a patch.

    @terryjreedy
    Copy link
    Member

    The relevant code in CallTips.py itself

        if isinstance(ob_call, types.MethodType):
            doc = ob_call.__doc__
        else:
            doc = getattr(ob, "__doc__", "")
        if doc: <add more to calltip>

    equally ignores both None and '', but I forgot the None possibility in the tests. I cannot test the patch, but the fix looks right. Putting the doc conditional expression before the for loops works because if one .__doc__ is set to None, all are. For the same reason, doc could be defined as a global name, but if the patch makes test_idle pass, it is fine as it is.

    @terryjreedy
    Copy link
    Member

    Whatever you do with the other -OO patches, I would prefer that this be applied to 3.4. The 3.4/3.5 files should be identical.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 4, 2015

    New changeset 912719dd684f by Serhiy Storchaka in branch '2.7':
    Issue bpo-23825: Fixed test_idle under -OO.
    https://hg.python.org/cpython/rev/912719dd684f

    New changeset 657ebef5b291 by Serhiy Storchaka in branch '3.4':
    Issue bpo-23825: Fixed test_idle under -OO.
    https://hg.python.org/cpython/rev/657ebef5b291

    New changeset e6654af0fc93 by Serhiy Storchaka in branch 'default':
    Issue bpo-23825: Fixed test_idle under -OO.
    https://hg.python.org/cpython/rev/e6654af0fc93

    @serhiy-storchaka serhiy-storchaka self-assigned this Apr 4, 2015
    @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
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants