Skip to content

Commit

Permalink
Merge pull request #1848 from Akasurde/i1753
Browse files Browse the repository at this point in the history
Check availability of poll method before using
  • Loading branch information
k8s-ci-robot authored Jul 4, 2022
2 parents 3165e80 + 13c4c76 commit 2677e9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kubernetes/base/stream/ws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def update(self, timeout=0):
# efficient as epoll. Will work for fd numbers above 1024.
# select.epoll() - newest and most efficient way of polling.
# However, only works on linux.
if sys.platform.startswith('linux') or sys.platform in ['darwin']:
if hasattr(select, "poll"):
poll = select.poll()
poll.register(self.sock.sock, select.POLLIN)
r = poll.poll(timeout)
Expand Down

0 comments on commit 2677e9c

Please sign in to comment.