Skip to content

Commit 4ebb2b9

Browse files
fix code for py37
1 parent 9859c11 commit 4ebb2b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/assertion/rewrite.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,13 @@ def run(self, mod: ast.Module) -> None:
687687
expect_docstring
688688
and isinstance(item, ast.Expr)
689689
and isinstance(item.value, astStr)
690-
and isinstance(item.value.value, str)
691690
):
692691
if sys.version_info >= (3, 8):
693692
doc = item.value.value
694693
else:
695694
doc = item.value.s
695+
if not isinstance(doc, str):
696+
return
696697
if self.is_rewrite_disabled(doc):
697698
return
698699
expect_docstring = False

0 commit comments

Comments
 (0)