-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Some fixes for Python 3 #23669
Some fixes for Python 3 #23669
Conversation
The change to the one file in |
Done in openssl/openssl#7409 |
Generally LGTM, but isn't |
The popular linter these days is |
@silverwind PyLint in its default configuration does not do very will on the following... import sys
abc = collections.namedtuple("abc", "a b c") # Missing import
hi = ur"hello" # Illegal in Python 3
for i in xrange(2): # Illegal in Python 3
long_i = long(i) # Illegal in Python 3
print i # Illegal in Python 3
if isinstance(i, basestring): # Illegal in Python 3
print(unicode(i)) # Illegal in Python 3
reload(sys) # Illegal in Python 3
sys.setdefaultencoding("utf-8") # Illegal in Python 3
async def async_print(s): # Illegal in Python 2
print(s, end=" ") # Illegal in Python 2 |
@@ -45,7 +46,7 @@ def main(): | |||
|
|||
cmd = ([os.path.abspath(os.path.join(THIS_DIR, FUZZER))] + sys.argv[2:] | |||
+ ["-artifact_prefix=" + corpora[1] + "/"] + corpora) | |||
print " ".join(cmd) | |||
print(" ".join(cmd)) |
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.
Merged in upstream in openssl/openssl#7409 but retained here because openssl in not pip installed but is vendored in.
Yes, IIRC, pylint needs quite a bit of configuration to be useful. Anyways, I'd appreciate if you'd remove linter-specific comments, we can decide on a python linter later on, this PR should be about fixing compatibilty only, the lint result doesn't need to be 100% clean. |
tools/jinja2/_compat.py
Outdated
@@ -10,6 +10,8 @@ | |||
:copyright: Copyright 2013 by the Jinja team, see AUTHORS. | |||
:license: BSD, see LICENSE for details. | |||
""" | |||
# flake8: noqa | |||
|
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.
suggesting to drop these based on my earlier comment.
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.
+1
It's also excluded from new lint-py
target:
https://github.com/nodejs/node/blob/4458162cfaf8c1eed987323fbb21c86783a8e914/Makefile#L1221-L1223
@cclauss do you mind if I close this issue as |
Python 3 compatibility fixes as discussed in #23659 (comment)
These changes get the test scores equivalent on the following two tests.
E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. Most other flake8 issues are merely "style violations" -- useful for readability but they do not effect runtime safety.
name
name
in__all__
@refack @eirnym