aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cgi/fcgi.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgi/fcgi.py b/cgi/fcgi.py
index 8677679..e59f8c8 100644
--- a/cgi/fcgi.py
+++ b/cgi/fcgi.py
@@ -987,10 +987,12 @@ class Server(object):
isFCGI = True
if isFCGI:
- sock = socket.fromfd(FCGI_LISTENSOCK_FILENO, socket.AF_INET,
- socket.SOCK_STREAM)
try:
+ sock = socket.fromfd(FCGI_LISTENSOCK_FILENO, socket.AF_INET,
+ socket.SOCK_STREAM)
sock.getpeername()
+ except AttributeError:
+ isFCGI = False
except socket.error, e:
if e[0] == errno.ENOTSOCK:
# Not a socket, assume CGI context.