Skip to content

Commit

Permalink
chore: pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
gforcada committed Nov 2, 2023
1 parent 4f1a5fb commit 48b589a
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions flake8_builtins.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import ast
import builtins
import inspect
import sys

from flake8 import utils as stdin_utils

if sys.version_info >= (3, 8):
NamedExpr = ast.NamedExpr
else: # There was no walrus operator before python3.8
NamedExpr = type('NamedExpr', (ast.AST,), {})


class BuiltinsChecker:
name = 'flake8_builtins'
Expand Down Expand Up @@ -88,7 +82,7 @@ def run(self):

value = None
for statement in ast.walk(tree):
if isinstance(statement, (ast.Assign, ast.AnnAssign, NamedExpr)):
if isinstance(statement, (ast.Assign, ast.AnnAssign, ast.NamedExpr)):
value = self.check_assignment(statement)

elif isinstance(statement, function_nodes):
Expand Down

0 comments on commit 48b589a

Please sign in to comment.