-
Notifications
You must be signed in to change notification settings - Fork 187
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
Workaround socket library import issue. #601
Conversation
try: | ||
import encodings.idna | ||
except ImportError: | ||
# Supposedly, some verions of Python (e.g. IronPython) do not support the |
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.
not really "versions"? more like implementations or flavors?
@@ -41,6 +41,17 @@ | |||
|
|||
from builtins import str | |||
|
|||
# Apparently, the Python `socket` library's call to `import encodings.idna` via | |||
# `socket.create_connection` via `socket.getaddrinfo` is not thread-safe in | |||
# embeded Python environments. So, pre-emptively import and cache the encoder. |
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.
"embedded"?
@@ -41,6 +41,17 @@ | |||
|
|||
from builtins import str | |||
|
|||
# Apparently, the Python `socket` library's call to `import encodings.idna` via | |||
# `socket.create_connection` via `socket.getaddrinfo` is not thread-safe in |
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.
two "via" chained together?
rephrase a bit? or simply shorten?
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.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @winterfroststrom and @xpconanfan)
mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 45 at r1 (raw file):
Previously, xpconanfan (Ang Li) wrote…
two "via" chained together?
rephrase a bit? or simply shorten?
changed
mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 46 at r1 (raw file):
Previously, xpconanfan (Ang Li) wrote…
"embedded"?
Done.
mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 51 at r1 (raw file):
Previously, xpconanfan (Ang Li) wrote…
not really "versions"? more like implementations or flavors?
Done.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @winterfroststrom)
mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 52 at r2 (raw file):
import encodings.idna except ImportError: # Supposedly, some implementations of Python (e.g. IronPython) do not support
Why "supposedly"? remove?
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @winterfroststrom and @xpconanfan)
mobly/controllers/android_device_lib/jsonrpc_client_base.py, line 52 at r2 (raw file):
Previously, xpconanfan (Ang Li) wrote…
Why "supposedly"? remove?
Done.
This change is