Commits

Jason R. Coombs  committed 6d909d9 Merge

Merge with cherrypy-3.2.x

  • Participants
  • Parent commits b0c4821, 9820107

Comments (0)

Files changed (1)

File cherrypy/process/servers.py

             s.settimeout(timeout)
             s.connect((host, port))
             s.close()
+        except socket.error:
+            if s:
+                s.close()
+        else:
             raise IOError("Port %s is in use on %s; perhaps the previous "
                           "httpserver did not shut down properly." %
                           (repr(port), repr(host)))
-        except socket.error:
-            if s:
-                s.close()
 
 
 # Feel free to increase these defaults on slow systems: