-
Notifications
You must be signed in to change notification settings - Fork 197
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
SG-29997 Removing Python 2 code #345
Changes from 2 commits
a1243d0
21a0ab1
2e32ef0
8e0b7c4
5f7dd2e
e28c56f
717af51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
from .. import six | ||
|
||
# Define all here to keep linters happy. It should be overwritten by the code | ||
# below, but if in the future __all__ is not defined in httplib2 this will keep | ||
# things from breaking. | ||
|
@@ -9,24 +7,13 @@ | |
# current python version. httplib2 supports python 2/3 by forking the code rather | ||
# than with a single cross-compatible module. Rather than modify third party code, | ||
# we'll just import the appropriate branch here. | ||
if six.PY3: | ||
# Generate ssl_error_classes | ||
import ssl as __ssl | ||
ssl_error_classes = (__ssl.SSLError, __ssl.CertificateError) | ||
del __ssl | ||
|
||
# get the python3 fork of httplib2 | ||
from . import python3 as __httplib2_compat | ||
|
||
|
||
else: | ||
# Generate ssl_error_classes | ||
from .python2 import SSLHandshakeError as __SSLHandshakeError # TODO: shouldn't rely on this. not public | ||
ssl_error_classes = (__SSLHandshakeError,) | ||
del __SSLHandshakeError | ||
# Generate ssl_error_classes | ||
import ssl as __ssl | ||
ssl_error_classes = (__ssl.SSLError, __ssl.CertificateError) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to keep this variable or can we just replace the code where ssl_error_classes is used by __ssl.SSLError, __ssl.CertificateError? |
||
del __ssl | ||
|
||
# get the python2 fork of httplib2 | ||
from . import python2 as __httplib2_compat | ||
# get the python3 fork of httplib2 | ||
from . import python3 as __httplib2_compat | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we have a "python3" folder in there? Can we simplify how we bundle httplib2 in this repo? |
||
|
||
# Import all of the httplib2 module. Note that we can't use a star import because | ||
# we need to import *everything*, not just what exists in __all__. | ||
|
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.
I don't think we want to edit httplib2. This is third-party we bundle. But can we update to a newer version if we drop py2?
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.
Actually, it was manually updated by #202 so we might want to clean up (or simply update to a newer version)