]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Eliminate a tautological-pointer-compare warning found by Clang.
authorBrett Cannon <brett@python.org>
Wed, 7 Sep 2016 21:07:16 +0000 (14:07 -0700)
committerBrett Cannon <brett@python.org>
Wed, 7 Sep 2016 21:07:16 +0000 (14:07 -0700)
Misc/NEWS
Modules/_scproxy.c

index 772cb7a93b75c692f670169d113f2144d0a36b7b..56d8434d810c6d032a4cf8128f507af5d7b73d23 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -97,6 +97,8 @@ Library
 
 - Issue #16113: Add SHA-3 and SHAKE support to hashlib module.
 
+- Eliminate a tautological-pointer-compare warning in _scproxy.c.
+
 - Issue #27776: The :func:`os.urandom` function does now block on Linux 3.17
   and newer until the system urandom entropy pool is initialized to increase
   the security. This change is part of the :pep:`524`.
index 68be458bf4e00515d5802dded5c1057bf4a4b8f5..1ce4b776f3e26908353a9a1f80cb501c3cd28b74 100644 (file)
@@ -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;