Emit python3 prints and exception catching.#55
Open
kanaka wants to merge 5 commits into
Open
Conversation
This is necessary to support incompatible syntax between python2 and python3 ASTs. In addition to general utf-8/bytes/string handling, the two biggest changes are that arguments are handled different in python3 and integers, floats, and strings are all treated as Constant rather than having their own class. A less significant change is that Try is now a single class rather than two different classes for the TryExcept and TryFinally cases. A couple of differences that are fixed yet (expression test cases for them are commented out in this commit): - negative numbers in an expression are encoded as a positive number within a '-' unary operation. - explicit unicode strings (starting with a u...) are not yet handled. Also, remove the testCoding test case file since all python3 files are UTF-8 now.
Add visit_Starred and remove specific visit_Call Starred handling since this is covered by the new visit_Starred. Enables parsing of "[*a]" case.
Use the stdout.buffer for writing to so that the behavior of write is to always take bytes. Also switch the tester to use BytesIO for the temporary write buffer for comparing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This isn't universal python3 support, but it was enough to support the python3 code I was wanting to minify.