📜  requests.packages.urllib3.util.retry 无法从源代码解析 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:51.886000             🧑  作者: Mango

代码示例1
# You might need a newer version of Requests. I just tried it with v2.5.1:
from requests.packages.urllib3.util import Retry
"""
Seems to work. FYI: The latest version is v2.5.3, worth upgrading.
Also if you have a reasonably recent version of urllib3 installed separately, 
this should also work:
"""
from urllib3.util import Retry

"""
Unfortunately we check the specific isinstance type of Retry in 
PoolManager and ConnectionPool, so the two types of Retry objects 
might not be perfectly interchangeable. 
(If anyone wants to fix this, I'd be +1 on a PR.)

For now, if you're intending on using the Retry object with the requests 
version of urllib3, you'll need to import it from there directly.
"""