'Detect if the \'no_proxy\' environment variable is set and honor those locations.'

def detect_no_proxy(self, url):

    env_no_proxy = os.environ.get('no_proxy')
    if env_no_proxy:
        env_no_proxy = env_no_proxy.split(',')
        netloc = urlparse(url).netloc
        for host in env_no_proxy:
            if (netloc.endswith(host) or netloc.split(':')[0].endswith(host)):
                return False
    return True
