-
Notifications
You must be signed in to change notification settings - Fork 206
Ensure all files are py2/py3 syntactically compatible #238
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
Conversation
| guess, encoding = guess_type(gtype, strict) | ||
| if not guess: print "I don't know anything about type", gtype | ||
| else: print 'type:', guess, 'encoding:', encoding | ||
| if not guess: print("I don't know anything about type %s" % gtype) |
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.
multiple statements on one line (colon)
| if not guess: print "I don't know anything about type", gtype | ||
| else: print guess | ||
| if not guess: print("I don't know anything about type %s" % gtype) | ||
| else: print(guess) |
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.
multiple statements on one line (colon)
| guess = guess_extension(gtype, strict) | ||
| if not guess: print "I don't know anything about type", gtype | ||
| else: print guess | ||
| if not guess: print("I don't know anything about type %s" % gtype) |
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.
multiple statements on one line (colon)
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.
Using a simple print() is compatible with py2/py3 (without the need for from __future__ import print_function).
The __future__ import is needed if/when a more advanced usage of print function is done, like for example print("foo", end=" ")
Printing a tuple behaves differently in py2/py3, so a simple string format was used here to make it py2/py3 equivalent
| print USAGE | ||
| if msg: print msg | ||
| print(USAGE) | ||
| if msg: print(msg) |
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.
multiple statements on one line (colon)
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.
Totally agree with hound bot, I left it as close to original as possible in this iteration however on purpose.
I'll gladly straighten this out though
| wrote_auth_header = False | ||
| if self.__proxy[6] != None: | ||
| for key, val in self.__proxy[6].iteritems(): | ||
| for key, val in self.__proxy[6].items(): |
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.
Similar change can be done in ../python2/socks.py, intentionally left that one as-is (as it's still syntactically OK, and presumably this one is the one selected at runtime for py3)
| ['help', 'lenient', 'extension']) | ||
| except getopt.error, msg: | ||
| except getopt.error as msg: | ||
| usage(1, msg) |
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.
|
We're dropping support for Python 2. We appreciate your contribution. |
This should allow to get closer to a place where
pip install git+https:...should work with shotgun-api