Skip to content

Commit fd4ef55

Browse files
Merged revisions 80243 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r80243 | ronald.oussoren | 2010-04-20 10:54:48 +0200 (Tue, 20 Apr 2010) | 3 lines This patch fixes the handling of a weak-linked variable and should fix issue python#8095. ........
1 parent 488fea3 commit fd4ef55

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Mac/Modules/_scproxy.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ get_proxy_settings(PyObject* mod __attribute__((__unused__)))
6464
result = PyDict_New();
6565
if (result == NULL) goto error;
6666

67-
aNum = CFDictionaryGetValue(proxyDict,
67+
if (&kSCPropNetProxiesExcludeSimpleHostnames != NULL) {
68+
aNum = CFDictionaryGetValue(proxyDict,
6869
kSCPropNetProxiesExcludeSimpleHostnames);
69-
if (aNum == NULL) {
70-
v = PyBool_FromLong(0);
71-
} else {
72-
v = PyBool_FromLong(cfnum_to_int32(aNum));
70+
if (aNum == NULL) {
71+
v = PyBool_FromLong(1);
72+
} else {
73+
v = PyBool_FromLong(cfnum_to_int32(aNum));
74+
}
75+
} else {
76+
v = PyBool_FromLong(1);
7377
}
78+
7479
if (v == NULL) goto error;
7580

7681
r = PyDict_SetItemString(result, "exclude_simple", v);

0 commit comments

Comments
 (0)