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

Avoid UnboundLocalError for exc #178

Closed
wants to merge 1 commit into from
Closed

Avoid UnboundLocalError for exc #178

wants to merge 1 commit into from

Conversation

no2a
Copy link
Contributor

@no2a no2a commented Jun 1, 2015

Previously exc was set only when an exception occurs in the inner
try (the one contains call to self.poll), so an error in the other
part causes an UnboundLocalError.

@kanaka
Copy link
Member

kanaka commented Jun 1, 2015

This change is currently not portable across the versions of python that we support (2.4-3.X). See: http://stackoverflow.com/questions/12682558/how-to-write-an-exception-catching-code-works-in-python2-4-to-python3

Can you update it to be portable (as described above) and update the pull request? Thanks

@DirectXMan12 DirectXMan12 added bug Something isn't working python labels Jun 2, 2015
@no2a
Copy link
Contributor Author

no2a commented Jun 5, 2015

Changed to get exc using sys.exc_info() as the other part of the file.

@DirectXMan12
Copy link
Member

Can you squash this into one commit (use git rebase -i and then git push --force)? Then it should be all set to merge. Thanks!

Previously exc was set only when an exception occurs in the inner
try (the one contains call to self.poll), so an error in the other
part causes an UnboundLocalError.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants