Jason R. Coombs  committed 9820107

Fix error in Python 3.3 where socket.error and IOError are the same exception class (OSError). Thanks to Alex Hill for the patch. Fixes #1170.

  • Participants
  • Parent commits 41d134f
  • Branches cherrypy-3.2.x

Comments (0)

Files changed (1)

File cherrypy/process/

             s.connect((host, port))
+        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: