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

Improve Python 2 only syntax detection #2592

Merged
merged 3 commits into from Nov 12, 2021

Commits on Nov 6, 2021

  1. Improve Python 2 only syntax detection

    First of all this fixes a mistake I made in Python 2 deprecation PR
    using token.* to check for print/exec statements. Turns out that
    for nodes with a type value higher than 256 its numeric type isn't
    guaranteed to be constant. Using syms.* instead fixes this.
    
    Also add support for the following cases:
    
        print "hello, world!"
    
        exec "print('hello, world!')"
    
        def set_position((x, y), value):
            pass
    
        try:
            pass
        except Exception, err:
            pass
    
        raise RuntimeError, "I feel like crashing today :p"
    
        `wow_these_really_did_exist`
    
        10L
    ichard26 committed Nov 6, 2021
    Copy the full SHA
    f2a54ee View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2021

  1. Add octal support, more test cases, and fixup long ints

    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    ichard26 and JelleZijlstra committed Nov 8, 2021
    Copy the full SHA
    78d32bf View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2021

  1. Copy the full SHA
    000e0f1 View commit details
    Browse the repository at this point in the history