diff options
author | Augie Fackler <durin42@gmail.com> | 2010-10-05 08:10:02 -0500 |
---|---|---|
committer | Augie Fackler <durin42@gmail.com> | 2010-10-05 08:10:02 -0500 |
commit | 7ad8867d9c54fbe710901dabce00f0c79079edd5 (patch) | |
tree | db136752e78022df9369a40cf16f1045cba6ccb5 /python2/httplib2/socks.py | |
parent | 37bc19fc4c2a29073f0f4d49ef3d324054e04796 (diff) | |
download | httplib2-7ad8867d9c54fbe710901dabce00f0c79079edd5.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.py | 4 |
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 |