src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/requestWithoutTimeout.py

branch
eric7
changeset 11136
437db2f032fd
parent 11090
f5f5f5803935
child 11137
a90284948331
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/requestWithoutTimeout.py	Sun Feb 16 11:26:03 2025 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/requestWithoutTimeout.py	Sun Feb 16 12:10:10 2025 +0100
@@ -43,9 +43,8 @@
     httpVerbs = {"get", "options", "head", "post", "put", "patch", "delete"}
     httpxAttrs = {"request", "stream", "Client", "AsyncClient"} | httpVerbs
     qualName = context.callFunctionNameQual.split(".")[0]
-    if (qualName == "requests" and context.callFunctionName in httpVerbs) or (
-        qualName == "httpx" and context.callFunctionName in httpxAttrs
-    ):
+
+    if qualName == "requests" and context.callFunctionName in httpVerbs:
         # check for missing timeout
         if context.checkCallArgValue("timeout") is None:
             reportError(
@@ -57,6 +56,12 @@
                 qualName,
             )
 
+    if (
+        qualName == "requests"
+        and context.callFunctionName in httpVerbs
+        or qualName == "httpx"
+        and context.callFunctionName in httpxAttrs
+    ):
         # check for timeout=None
         if context.checkCallArgValue("timeout", "None"):
             reportError(

eric ide

mercurial