-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support running on Python 3 #3
Conversation
…ects that have __slots__
…railing whitespace
Note: when running redhawk with this patch series on Python 3, it will only work on common subset of Python 2 and Python 3. IOW, it won't work on e.g.
or
If run on Python 2, it will still analyze Python 2 code correctly. Analyzing Python 3 constructs when running on Python 3 will require some additional work (adding Converters and Nodes for these constructs). |
@@ -130,6 +132,8 @@ | |||
import re | |||
import sys | |||
|
|||
from six.moves import filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only file that the six module is now being imported for. In this file, filter is used only at Line 226. Replacing it with list(filter(..)) will enable us to remove this import, thereby removing six as a dependency altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, will do.
I have three comments:
We will also need a way to separate out if-else pattern when Python 3 support starts. I will think about a way of doing so in the near future. Change is looking good. Please address the above and I'll accept the Pull request. Thanks for doing this! |
So I think I addressed all of your points, but I started testing on Python 3.5 and there seem to be some new test failures, so I'm going to investigate them. Please don't merge yet. |
Ok, fixed Python 3.5 compatibility and pushed. Ready to be re-reviewed and merged. |
Changes look good - I've merged this to master. Thanks everybody for pitching in and helping fix this issue. Appreciate this! :-) @bkabrda: Good spot with ConverListOfStatements! |
Thanks a lot for the review and for accepting, @spranesh! |
Thanks @bkabrda @ncoghlan @jpopelka for your contributions! I've just released a version containing these changes (and some bug fixes). This version will enable redhawk to run via Python3. However, it may still barf when analyzing some Python3 codebases. This is important, but will take significant development time to fix (Issue #2 and Issue #3). |
This patch series covers: