Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

serve: catch errors at server launch

This was why the dialog was locking up on errors. Fixes #246

Changeset 196e42d8880e

Parent 8ca560af823d

by Steve Borho

Changes to one file · Browse files at 196e42d8880e Showing diff from parent 8ca560af823d Diff from another changeset...

Change 1 of 1 Show Entire File hggtk/​serve.py Stacked
 
238
239
240
241
 
242
 
 
 
 
 
243
244
245
 
238
239
240
 
241
242
243
244
245
246
247
248
249
250
@@ -238,8 +238,13 @@
  thread = threading.Thread(target=threadfunc, args=args)   thread.start()   - while not gservice or not hasattr(gservice, 'httpd'): + while True:   time.sleep(0.1) + if gservice and hasattr(gservice, 'httpd'): + break + if not thread.isAlive(): + return +   # gservice.httpd.fqaddr turned out to be unreliable, so use   # loopback addr directly   self._url = 'http://127.0.0.1:%d/' % (port)