fix compatibility with python-requests >= 1.0