Fix use of deprecated ast.Str (#4393)

This commit is contained in:
Jelle Zijlstra 2024-07-04 16:26:42 -07:00 committed by GitHub
parent 978bc505ac
commit 5e571ccbbe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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