Skip to content

Argument Clinic incorretly translates #elif #84360

Closed

Description

@serhiy-storchaka
BPO 40179
Nosy @larryhastings, @serhiy-storchaka
PRs
  • bpo-40179: Fix translation of #elif in Argument Clinic #19364
  • bpo-40178: Convert the remaining os functions to Argument Clinic. #19360
  • [3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) #19583
  • [3.7] bpo-40179: Fix translation of GH-elif in Argument Clinic (GH-19364) #19584
  • 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 = None
    closed_at = <Date 2020-04-18.16:13:03.047>
    created_at = <Date 2020-04-04.16:26:41.655>
    labels = ['3.8', 'build', '3.7', 'expert-argument-clinic', '3.9']
    title = 'Argument Clinic incorretly translates #elif'
    updated_at = <Date 2020-04-18.16:13:03.047>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-04-18.16:13:03.047>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-04-18.16:13:03.047>
    closer = 'serhiy.storchaka'
    components = ['Build', 'Argument Clinic']
    creation = <Date 2020-04-04.16:26:41.655>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40179
    keywords = ['patch']
    message_count = 6.0
    messages = ['365769', '365772', '365790', '366721', '366723', '366724']
    nosy_count = 2.0
    nosy_names = ['larry', 'serhiy.storchaka']
    pr_nums = ['19364', '19360', '19583', '19584']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue40179'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    Activity

    1. serhiy-storchaka commented on Apr 4, 2020

      @serhiy-storchaka
      MemberAuthor

      It converts

          #if A
          ...
          #elif B
          ...
          #else
          ...
          #endif

      into

          #if A
          ...
          #endif /* A */
      
          #if B
          ...
          #endif /* B */
      
          #if !B
          ...
          #endif /* !B */

      The correct translation is:

          #if A
          ...
          #endif /* A */
      
          #if !A && B
          ...
          #endif /* !A && B */
      
          #if !A && !B
          ...
          #endif /* !A && !B */
    2. added
      3.7 (EOL)
      3.8 (EOL)
      3.9 (EOL)
      build
      on Apr 4, 2020
    3. larryhastings commented on Apr 4, 2020

      @larryhastings
      Contributor

      Good catch, and thanks for submitting a patch too! I want to play with your patch a little before I just say "yes of course".

    4. serhiy-storchaka commented on Apr 4, 2020

      @serhiy-storchaka
      MemberAuthor

      See PR 19360 for real example.

    5. serhiy-storchaka commented on Apr 18, 2020

      @serhiy-storchaka
      MemberAuthor

      New changeset 12446e6 by Serhiy Storchaka in branch 'master':
      bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364)
      12446e6

    6. serhiy-storchaka commented on Apr 18, 2020

      @serhiy-storchaka
      MemberAuthor

      New changeset bfda4db by Serhiy Storchaka in branch '3.8':
      [3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583)
      bfda4db

    7. serhiy-storchaka commented on Apr 18, 2020

      @serhiy-storchaka
      MemberAuthor

      New changeset 67ae454 by Serhiy Storchaka in branch '3.7':
      [3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584)
      67ae454

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)3.8 (EOL)3.9 (EOL)buildtopic-argument-clinic

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions