summaryrefslogtreecommitdiff
path: root/python2/httplib2/socks.py
diff options
context:
space:
mode:
authorAugie Fackler <durin42@gmail.com>2010-10-05 08:10:02 -0500
committerAugie Fackler <durin42@gmail.com>2010-10-05 08:10:02 -0500
commit5c1b00a03221f55ac48b0d34030160cf55b4225f (patch)
treedb136752e78022df9369a40cf16f1045cba6ccb5 /python2/httplib2/socks.py
parenta9d82cae27af6fe29929097214cf6d3cc54fbaa0 (diff)
downloadhttplib2-5c1b00a03221f55ac48b0d34030160cf55b4225f.tar.gz
proxy support: degrade gracefully when socket.socket is unavailable
This should allow httplib2 to continue to work even on platforms like appengine where the socket module exists but has no socket attribute.
Diffstat (limited to 'python2/httplib2/socks.py')
-rw-r--r--python2/httplib2/socks.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python2/httplib2/socks.py b/python2/httplib2/socks.py
index 2bddd7a..b65fb38 100644
--- a/python2/httplib2/socks.py
+++ b/python2/httplib2/socks.py
@@ -41,6 +41,10 @@ mainly to merge bug fixes found in Sourceforge
"""
import socket
+
+if getattr(socket, 'socket', None) is None:
+ raise ImportError('socket.socket missing, proxy support unusable')
+
import struct
import sys