summaryrefslogtreecommitdiff
path: root/pylint/checkers/nested_min_max.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/checkers/nested_min_max.py')
-rw-r--r--pylint/checkers/nested_min_max.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pylint/checkers/nested_min_max.py b/pylint/checkers/nested_min_max.py
index e9aa409f0..8825f296e 100644
--- a/pylint/checkers/nested_min_max.py
+++ b/pylint/checkers/nested_min_max.py
@@ -1,6 +1,6 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
-# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
+# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
+# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
"""Check for use of nested min/max functions."""
@@ -10,6 +10,7 @@ import copy
from typing import TYPE_CHECKING
from astroid import nodes, objects
+from astroid.const import Context
from pylint.checkers import BaseChecker
from pylint.checkers.utils import only_required_for_messages, safe_infer
@@ -96,7 +97,14 @@ class NestedMinMaxChecker(BaseChecker):
if isinstance(
inferred, (nodes.List, nodes.Tuple, nodes.Set, *DICT_TYPES)
):
- splat_node = nodes.Starred(lineno=inferred.lineno)
+ splat_node = nodes.Starred(
+ ctx=Context.Load,
+ lineno=inferred.lineno,
+ col_offset=0,
+ parent=nodes.NodeNG(),
+ end_lineno=0,
+ end_col_offset=0,
+ )
splat_node.value = arg
fixed_node.args = (
fixed_node.args[:idx]