1. Jose Neto
  2. CherryPy

Commits

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/servers.py

View file
  • Ignore whitespace
             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: