Ensure the docstring is a string

This commit is contained in:
Tushar Sadhwani 2023-06-26 12:14:41 +05:30 committed by GitHub
parent 5eaf8207eb
commit 9859c110cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -687,6 +687,7 @@ class AssertionRewriter(ast.NodeVisitor):
expect_docstring
and isinstance(item, ast.Expr)
and isinstance(item.value, astStr)
and isinstance(item.value.value, str)
):
if sys.version_info >= (3, 8):
doc = item.value.value