[Checkins] SVN: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py use subprocess api

Jan-Wijbrand Kolman janwijbrand at gmail.com
Thu Jun 3 09:16:06 EDT 2010


Log message for revision 113003:
  use subprocess api

Changed:
  U   gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py

-=-
Modified: gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py
===================================================================
--- gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py	2010-06-03 13:10:44 UTC (rev 113002)
+++ gocept.selenium/branches/jw-staticfiles-testlayer/src/gocept/selenium/static/__init__.py	2010-06-03 13:16:05 UTC (rev 113003)
@@ -39,19 +39,15 @@
     def start_server(self):
         cmd = [sys.executable, '-m', 'SimpleHTTPServer', str(self.port)]
         self.server = subprocess.Popen(cmd, cwd=self.documentroot)
-        # Wait a little as it sometimes takes a while to
-        # get the server started.
+        # Wait a little as it sometimes takes a while to get the server
+        # started.
         time.sleep(0.25)
 
     def stop_server(self):
         if self.server is None:
             return
-        try:
-            # Kill the previously started SimpleHTTPServer process.
-            os.kill(self.server.pid, signal.SIGKILL)
-            self.server = None
-        except OSError, e:
-            print 'Could not kill process, do so manually. Reason:\n' + str(e)
+        self.server.kill()
+        self.server = None
 
     def tearDown(self):
         # Clean up after our behinds.



More information about the checkins mailing list