我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用urllib.request.proxy_bypass_environment()。
def test_getproxies_environment_keep_no_proxies(self): self.env.set('NO_PROXY', 'localhost') proxies = urllib_request.getproxies_environment() # getproxies_environment use lowered case truncated (no '_proxy') keys self.assertEqual('localhost', proxies['no']) # List of no_proxies with space. self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com') self.assertTrue(urllib_request.proxy_bypass_environment('anotherdomain.com'))