Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.functions: Attempt to make
server
open the browser *after* the ser…
…ver has started
- Loading branch information
c03c541
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how I made it open the browser after the server has started:
c03c541
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn’t that still open the browser before the server is started (
SimpleHTTPServer.test()
)? Or in practice, has the server started by the time the browser opened the URL?I’m not saying the
sleep 1
-style race condition is any better, just wondering.c03c541
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the function above I've never encountered the browser opening before the server has started, even with a really slow Mac. I think (though I don't have any proof) that the slowness is the Python interpreter starting. By having everything as Python, we bypass that race. I could of course put the os.system last, but I didn't notice any difference doing so.