diff --git a/cherrypy/_cpwsgiserver.py b/cherrypy/_cpwsgiserver.py
index <HASH>..<HASH> 100644
--- a/cherrypy/_cpwsgiserver.py
+++ b/cherrypy/_cpwsgiserver.py
@@ -286,6 +286,8 @@ class CherryPyWSGIServer(object):
                 self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
                 self.socket.bind(self.bind_addr)
             else:
+                self.socket = None
+                msg = "No socket could be created"
                 for res in info:
                     af, socktype, proto, canonname, sa = res
                     try:
Fix for #<I> (CherryPyWSGIServer does not always initalize self.socket) in 2.x and trunk.