]> granicus.if.org Git - python/commitdiff
This patch fixes the handling of a weak-linked
authorRonald Oussoren <ronaldoussoren@mac.com>
Tue, 20 Apr 2010 08:54:48 +0000 (08:54 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Tue, 20 Apr 2010 08:54:48 +0000 (08:54 +0000)
variable and should fix issue #8095.

Mac/Modules/_scproxy.c

index 003f6a483f09a677629da51a2ee4b5ab3d49f87b..9f4c1a4e8f1c845fe29e624755349fe0fce1d943 100644 (file)
@@ -64,13 +64,18 @@ get_proxy_settings(PyObject* mod __attribute__((__unused__)))
        result = PyDict_New();
        if (result == NULL) goto error;
 
-       aNum = CFDictionaryGetValue(proxyDict, 
+       if (&kSCPropNetProxiesExcludeSimpleHostnames != NULL) {
+               aNum = CFDictionaryGetValue(proxyDict, 
                        kSCPropNetProxiesExcludeSimpleHostnames);
-       if (aNum == NULL) {
-               v = PyBool_FromLong(0);
-       } else {
-               v = PyBool_FromLong(cfnum_to_int32(aNum));
+               if (aNum == NULL) {
+                       v = PyBool_FromLong(1);
+               } else {
+                       v = PyBool_FromLong(cfnum_to_int32(aNum));
+               }
+       }  else {
+               v = PyBool_FromLong(1);
        }
+
        if (v == NULL) goto error;
 
        r = PyDict_SetItemString(result, "exclude_simple", v);