[py-svn] r37063 - py/branch/config/py/test/rsession

arigo at codespeak.net arigo at codespeak.net
Sat Jan 20 17:00:33 CET 2007


Author: arigo
Date: Sat Jan 20 17:00:31 2007
New Revision: 37063

Modified:
   py/branch/config/py/test/rsession/rsession.py
Log:
webbrowser.open() may block until the browser finishes or not, so better
start it from a background thread.  An case where it blocks is if you
define the $BROWSER environment variable.



Modified: py/branch/config/py/test/rsession/rsession.py
==============================================================================
--- py/branch/config/py/test/rsession/rsession.py	(original)
+++ py/branch/config/py/test/rsession/rsession.py	Sat Jan 20 17:00:31 2007
@@ -61,8 +61,10 @@
             reporter = exported_methods.report
             start_server()
             if self.config.option.runbrowser:
-                import webbrowser
-                webbrowser.open("http://localhost:8000")
+                import webbrowser, thread
+                # webbrowser.open() may block until the browser finishes or not
+                url = "http://localhost:8000"
+                thread.start_new_thread(webbrowser.open, (url,))
         elif reporter is None: 
             if restflag:
                 from py.__.test.rsession.rest import RestReporter


More information about the py-svn mailing list