AttributeError: type object '_socketobject' has no attribute 'timeout'

python-env/lib/python2.7/site-packages/apns.py", line 142, in _connect
    except socket.timeout:
AttributeError: type object '_socketobject' has no attribute 'timeout'