We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4515443 commit 65305d8Copy full SHA for 65305d8
1 file changed
cherrypy/process/wspbus.py
@@ -81,6 +81,8 @@
81
import subprocess
82
import functools
83
84
+from more_itertools import always_iterable
85
+
86
87
# Here I save the value of os.getcwd(), which, if I am imported early enough,
88
# will be the directory from which the startup script was run. This is needed
@@ -368,10 +370,7 @@ def block(self, interval=0.1):
368
370
369
371
def wait(self, state, interval=0.1, channel=None):
372
"""Poll for the given state(s) at intervals; publish to channel."""
- if isinstance(state, (tuple, list)):
- states = state
373
- else:
374
- states = [state]
+ states = set(always_iterable(state))
375
376
while self.state not in states:
377
time.sleep(interval)
0 commit comments