1. Tim Golden
  2. CherryPy


Robert Brewer  committed bf9a17c

Buried a couple socket, threading module imports for easier Google App Engine integration.

  • Participants
  • Parent commits a21997b
  • Branches default

Comments (0)

Files changed (2)

File cherrypy/_cpserver.py

View file
  • Ignore whitespace
 """Manage HTTP servers with CherryPy."""
-import socket
 import warnings
 import cherrypy
             # is INADDR_ANY and :: is IN6ADDR_ANY.
             # Look up the host name, which should be the
             # safest thing to spit out in a URL.
+            import socket
             host = socket.gethostname()
         port = self.socket_port

File cherrypy/process/servers.py

View file
  • Ignore whitespace
 """Adapt an HTTP server."""
-import socket
-import threading
 import time
         if isinstance(self.bind_addr, tuple):
+        import threading
         t = threading.Thread(target=self._start_http_thread)
         t.setName("HTTPServer " + t.getName())
     host = client_host(host)
     port = int(port)
+    import socket
     # AF_INET or AF_INET6 socket
     # Get the correct address family for our host (allows IPv6 addresses)
     for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,