fix code for py37

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

View File

@ -687,12 +687,13 @@ 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
else:
doc = item.value.s
if not isinstance(doc, str):
return
if self.is_rewrite_disabled(doc):
return
expect_docstring = False