Skip to content

Commit

Permalink
Use list() around the call to map.keys()
Browse files Browse the repository at this point in the history
Since in Python 3 it no longer returns a list, it returns a view
  • Loading branch information
digitalresistor committed Apr 25, 2022
1 parent fb33aaa commit 729170f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/waitress/wasyncore.py
Expand Up @@ -151,7 +151,7 @@ def poll(timeout=0.0, map=None):
if map is None: # pragma: no cover
map = socket_map
if map:
fds = map.keys()
fds = list(map.keys())

while True:
r = []
Expand Down Expand Up @@ -179,8 +179,9 @@ def poll(timeout=0.0, map=None):
r, w, e = select.select(r, w, e, timeout)
except OSError as err:
if err.args[0] == EBADF: # pragma: no cover
if fds != map.keys():
fds = map.keys()
_fds = list(map.keys())
if fds != _fds:
fds = _fds
continue
if err.args[0] != EINTR:
raise
Expand Down

0 comments on commit 729170f

Please sign in to comment.