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

pyparser does not correctly handle exception handlers #227

Closed
sqlalchemy-bot opened this issue Apr 13, 2014 · 4 comments
Closed

pyparser does not correctly handle exception handlers #227

sqlalchemy-bot opened this issue Apr 13, 2014 · 4 comments
Labels

Comments

@sqlalchemy-bot
Copy link

@sqlalchemy-bot sqlalchemy-bot commented Apr 13, 2014

Migrated issue, originally created by Dolda2000 (@Dolda2000)

The FindIdentifiers code in pyparser crashes on an exception handler that uses an expression other than a simple name for the exception type.

The fix is simple. Line 105 in pyparser.py is currently:

self.listener.undeclared_identifiers.add(node.type.id)

Simply replace with this:

self.visit(node.type)
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Apr 13, 2014

Changes by Dolda2000 (@Dolda2000):

  • edited description
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Apr 13, 2014

Michael Bayer (@zzzeek) wrote:

python 3 only apparently

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Apr 13, 2014

Michael Bayer (@zzzeek) wrote:

  • Fixed bug in Python parsing logic which would fail on Python 3
    when a "try/except" targeted a tuple of exception types, rather
    than a single exception. fixes #227

c314ecf

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Apr 13, 2014

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant