[Python-checkins] r80243 - python/trunk/Mac/Modules/_scproxy.c

ronald.oussoren python-checkins at python.org
Tue Apr 20 10:54:48 CEST 2010


Author: ronald.oussoren
Date: Tue Apr 20 10:54:48 2010
New Revision: 80243

Log:
This patch fixes the handling of a weak-linked
variable and should fix issue #8095.


Modified:
   python/trunk/Mac/Modules/_scproxy.c

Modified: python/trunk/Mac/Modules/_scproxy.c
==============================================================================
--- python/trunk/Mac/Modules/_scproxy.c	(original)
+++ python/trunk/Mac/Modules/_scproxy.c	Tue Apr 20 10:54:48 2010
@@ -64,13 +64,18 @@
 	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);


More information about the Python-checkins mailing list