We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f07bb8 commit 15ed248Copy full SHA for 15ed248
pyghthouse/ph.py
@@ -212,7 +212,14 @@ def start(self):
212
self.connect()
213
self.stop()
214
self.msg_handler.reset()
215
- while not self.connector.connection_state==ConnectionState.CONNECTED:
+ while True:
216
+ state=self.connector.connection_state
217
+ if state==ConnectionState.CONNECTED:
218
+ # Connected
219
+ break
220
+ elif state==ConnectionState.FAILED:
221
+ # Connection failed
222
+ raise ConnectionError("Failed to connect")
223
sleep(100)
224
self.ph_thread = self.PHThread(self)
225
self.ph_thread.start()
0 commit comments