airtime_analyzer unit test backwards compatibility with older versions of requests

This commit is contained in:
Albert Santoni 2015-07-08 10:32:35 -04:00
parent 3cebbaf29a
commit 67c5b73db4
1 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,10 @@ import pickle
import threading import threading
from urlparse import urlparse from urlparse import urlparse
requests.packages.urllib3.disable_warnings() # Disable urllib3 warnings because these can cause a rare deadlock due to Python 2's crappy internal non-reentrant locking
# around POSIX stuff. See SAAS-714. The hasattr() is for compatibility with older versions of requests.
if hasattr(requests, 'packages'):
requests.packages.urllib3.disable_warnings()
class PicklableHttpRequest: class PicklableHttpRequest:
def __init__(self, method, url, data, api_key): def __init__(self, method, url, data, api_key):