summaryrefslogtreecommitdiff
path: root/flup/client/fcgi_app.py
diff options
context:
space:
mode:
Diffstat (limited to 'flup/client/fcgi_app.py')
-rw-r--r--flup/client/fcgi_app.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/flup/client/fcgi_app.py b/flup/client/fcgi_app.py
index c1c15ec..f4dc9bb 100644
--- a/flup/client/fcgi_app.py
+++ b/flup/client/fcgi_app.py
@@ -31,6 +31,7 @@ import select
import struct
import socket
import errno
+import types
__all__ = ['FCGIApp']
@@ -386,11 +387,14 @@ class FCGIApp(object):
if self._connect is not None:
# The simple case. Create a socket and connect to the
# application.
- if type(self._connect) is str:
+ if isinstance(self._connect, types.StringTypes):
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ sock.connect(self._connect)
+ elif hasattr(socket, 'create_connection'):
+ sock = socket.create_connection(self._connect)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- sock.connect(self._connect)
+ sock.connect(self._connect)
return sock
# To be done when I have more time...