[Checkins] SVN: gocept.selenium/branches/janjaapdriessen-wsgi/src/gocept/selenium/static/__init__.py Use the name of the application in the layer name in order to distinguish WSGI layers.

Jan-Jaap Driessen jdriessen at thehealthagency.com
Fri Dec 10 08:11:13 EST 2010


Log message for revision 118786:
  Use the name of the application in the layer name in order to distinguish WSGI layers.

Changed:
  U   gocept.selenium/branches/janjaapdriessen-wsgi/src/gocept/selenium/static/__init__.py

-=-
Modified: gocept.selenium/branches/janjaapdriessen-wsgi/src/gocept/selenium/static/__init__.py
===================================================================
--- gocept.selenium/branches/janjaapdriessen-wsgi/src/gocept/selenium/static/__init__.py	2010-12-09 22:25:19 UTC (rev 118785)
+++ gocept.selenium/branches/janjaapdriessen-wsgi/src/gocept/selenium/static/__init__.py	2010-12-10 13:11:12 UTC (rev 118786)
@@ -72,7 +72,15 @@
 
     def shutdown(self):
         self._continue = False
-        urllib.urlopen('http://%s:%s/' % (self.server_name, self.server_port))
+        # We fire a last request at the server in order to take it out of the
+        # while loop in `self.serve_until_shutdown`.
+        try:
+            urllib.urlopen('http://%s:%s/' % (self.server_name,
+                                              self.server_port))
+        except IOError:
+            # If the server is already shut down, we receive a socket error,
+            # which we ignore.
+            pass
         self.server_close()
 
 



More information about the checkins mailing list