Skip to content

Commit

Permalink
Fixes CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Feb 8, 2021
1 parent efdb835 commit 6b810af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wemake_python_styleguide/visitors/ast/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ def visit_any_function(self, node: AnyFunctionDef) -> None:

def _check_new_decorator_syntax(self, node: AnyFunctionDef) -> None:
for decorator in node.decorator_list:
if not self._is_allowed_decorator(decorator):
if not self._is_allowed_decorator(decorator): # pragma: py-lt-39
self.add_violation(NewStyledDecoratorViolation(decorator))

def _is_allowed_decorator(self, decorator: ast.expr) -> bool:
if not isinstance(decorator, _ALLOWED_DECORATOR_TYPES):
def _is_allowed_decorator(self, node: ast.expr) -> bool:
if not isinstance(node, _ALLOWED_DECORATOR_TYPES): # pragma: py-lt-39
return False

if isinstance(decorator, ast.Name):
if isinstance(node, ast.Name):
return True # Simple names are fine!

return all(
isinstance(part, _ALLOWED_DECORATOR_TYPES)
for part in attributes.parts(decorator)
for part in attributes.parts(node)
)

0 comments on commit 6b810af

Please sign in to comment.