Skip to content

Conversation

@zsimic
Copy link

@zsimic zsimic commented Nov 17, 2020

This should allow to get closer to a place where pip install git+https:... should work with shotgun-api

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)
Copy link

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)
Copy link

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)
Copy link

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)

Copy link
Author

@zsimic zsimic Nov 17, 2020

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)
Copy link

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)

Copy link
Author

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():
Copy link
Author

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)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlos-villavicencio-adsk
Copy link
Contributor

We're dropping support for Python 2. We appreciate your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants