Skip to content

Commit

Permalink
Fix use of deprecated ast.Str
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra committed Jul 4, 2024
1 parent 978bc50 commit 071e42b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/black/handle_ipynb_magics.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ def _is_ipython_magic(node: ast.expr) -> TypeGuard[ast.Attribute]:
def _get_str_args(args: List[ast.expr]) -> List[str]:
str_args = []
for arg in args:
assert isinstance(arg, ast.Str)
str_args.append(arg.s)
assert isinstance(arg, ast.Constant) and isinstance(arg.value, str)
str_args.append(arg.value)
return str_args


Expand Down

0 comments on commit 071e42b

Please sign in to comment.