Skip to content

Commit 331f9d7

Browse files
committed
pipeline fixes
1 parent fe0aa92 commit 331f9d7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

mypy/stubtest.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,15 +1587,15 @@ def wrap_value(s: str) -> ast.Constant:
15871587
except NameError:
15881588
try:
15891589
value = eval(s, sys_module_dict)
1590-
except NameError:
1591-
raise ValueError
1590+
except NameError as err:
1591+
raise ValueError from err
15921592

15931593
if isinstance(value, (str, int, float, bytes, bool, type(None))):
15941594
return ast.Constant(value)
15951595
raise ValueError
15961596

15971597
class RewriteSymbolics(ast.NodeTransformer):
1598-
def visit_Attribute(self, node: ast.Attribute) -> Any:
1598+
def visit_Attribute(self, node: ast.Attribute) -> Any: # noqa: N802
15991599
a = []
16001600
n: ast.expr = node
16011601
while isinstance(n, ast.Attribute):
@@ -1607,12 +1607,12 @@ def visit_Attribute(self, node: ast.Attribute) -> Any:
16071607
value = ".".join(reversed(a))
16081608
return wrap_value(value)
16091609

1610-
def visit_Name(self, node: ast.Name) -> Any:
1610+
def visit_Name(self, node: ast.Name) -> Any: # noqa: N802
16111611
if not isinstance(node.ctx, ast.Load):
16121612
raise ValueError()
16131613
return wrap_value(node.id)
16141614

1615-
def visit_BinOp(self, node: ast.BinOp) -> Any:
1615+
def visit_BinOp(self, node: ast.BinOp) -> Any: # noqa: N802
16161616
# Support constant folding of a couple simple binary operations
16171617
# commonly used to define default values in text signatures
16181618
left = self.visit(node.left)
@@ -1660,6 +1660,7 @@ def p(name_node: ast.arg, default_node: Any, default: Any = empty) -> None:
16601660
else:
16611661
kind = Parameter.POSITIONAL_OR_KEYWORD
16621662
for i, (name, default) in enumerate(reversed(list(iter))):
1663+
assert name is not None
16631664
p(name, default)
16641665
if i == last_positional_only:
16651666
kind = Parameter.POSITIONAL_OR_KEYWORD

0 commit comments

Comments
 (0)