summaryrefslogtreecommitdiff
path: root/Modules/_scproxy.c
diff options
context:
space:
mode:
authorMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:16:58 -0800
committerMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:16:58 -0800
commitda79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (patch)
tree74845e2dbd9521d9748b9c32f1922f4123083bf3 /Modules/_scproxy.c
parente3c7e835bdfc97750eb9b7fc0ad2493108c2d438 (diff)
parent1fe806ac56f8b83694d24ab604eb695d00bc8497 (diff)
downloadcpython-da79bcf8ac7ae72218ab023e1ed54390bc1a3a27.tar.gz
Issue #29371: merge with 3.5
Diffstat (limited to 'Modules/_scproxy.c')
-rw-r--r--Modules/_scproxy.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/Modules/_scproxy.c b/Modules/_scproxy.c
index 66b6e3439f..1ce4b776f3 100644
--- a/Modules/_scproxy.c
+++ b/Modules/_scproxy.c
@@ -71,16 +71,12 @@ get_proxy_settings(PyObject* mod __attribute__((__unused__)))
result = PyDict_New();
if (result == NULL) goto error;
- if (&kSCPropNetProxiesExcludeSimpleHostnames != NULL) {
- aNum = CFDictionaryGetValue(proxyDict,
- kSCPropNetProxiesExcludeSimpleHostnames);
- if (aNum == NULL) {
- v = PyBool_FromLong(0);
- } else {
- v = PyBool_FromLong(cfnum_to_int32(aNum));
- }
- } else {
+ aNum = CFDictionaryGetValue(proxyDict,
+ kSCPropNetProxiesExcludeSimpleHostnames);
+ if (aNum == NULL) {
v = PyBool_FromLong(0);
+ } else {
+ v = PyBool_FromLong(cfnum_to_int32(aNum));
}
if (v == NULL) goto error;
@@ -130,7 +126,7 @@ error:
}
static int
-set_proxy(PyObject* proxies, char* proto, CFDictionaryRef proxyDict,
+set_proxy(PyObject* proxies, const char* proto, CFDictionaryRef proxyDict,
CFStringRef enabledKey,
CFStringRef hostKey, CFStringRef portKey)
{