Skip to content

Commit 15134dc

Browse files
committed
considering-kwargs-dict
1 parent 7397be6 commit 15134dc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pylint/checkers/method_args.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def visit_call(self, node: nodes.Call) -> None:
7373
inferred = utils.safe_infer(node.func)
7474
if inferred and inferred.qname() in self.config.timeout_methods:
7575
for keyword in node.keywords:
76-
if keyword.arg == "timeout":
76+
if isinstance(keyword, nodes.Keyword) or keyword.arg == "timeout":
7777
break
7878
else:
7979
self.add_message(

tests/functional/m/missing/missing_timeout.py

+6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
put("http://localhost") # [missing-timeout]
5151
request("call", "http://localhost") # [missing-timeout]
5252

53+
kwargs_wo_timeout = {}
54+
post("http://localhost", **kwargs_wo_timeout)
55+
5356
# requests valid cases
5457
requests.delete("http://localhost", timeout=10)
5558
requests.get("http://localhost", timeout=10)
@@ -77,3 +80,6 @@
7780
post("http://localhost", timeout=10)
7881
put("http://localhost", timeout=10)
7982
request("call", "http://localhost", timeout=10)
83+
84+
kwargs_timeout = {'timeout': 10}
85+
post("http://localhost", **kwargs_timeout)

0 commit comments

Comments
 (0)