Skip to content

Commit 5c60d66

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 111a3c4 commit 5c60d66

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

mypy/checker.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8881,12 +8881,10 @@ def visit_assignment_stmt(self, s: AssignmentStmt) -> None:
88818881
for lv in s.lvalues:
88828882
lv.accept(self)
88838883
if isinstance(lv, MemberExpr):
8884-
if lv.name == '__class__':
8884+
if lv.name == "__class__":
88858885
self.errors.report(
8886-
lv.line,
8887-
lv.column,
8888-
"Assignment to '__class__' is unsafe and not allowed"
8889-
)
8886+
lv.line, lv.column, "Assignment to '__class__' is unsafe and not allowed"
8887+
)
88908888
self.lvalue = False
88918889

88928890
def visit_name_expr(self, e: NameExpr) -> None:

test-data/unit/check-assign-to-class.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ class E:
2020
x = 1
2121
def baz(self):
2222
self.x = 2 # OK
23-

0 commit comments

Comments
 (0)