1 new commit in pytest: https://bitbucket.org/pytest-dev/pytest/commits/5fdb1399c25f/ Changeset: 5fdb1399c25f Branch: pytest-2.7 User: hpk42 Date: 2015-06-04 05:52:25+00:00 Summary: backport fixed issue735 Affected #: 2 files
diff -r 7227c7098c9d4dee502cf1f53818c02c153ef587 -r 5fdb1399c25fcd6c4ed7d663b026f5fc8b9c8c04 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +2.7.2 (compared to 2.7.1) +----------------------------- + +- fix issue735: assertion failures on debug versions of Python 3.4+ + Thanks Benjamin Peterson. + 2.7.1 (compared to 2.7.0) ----------------------------- diff -r 7227c7098c9d4dee502cf1f53818c02c153ef587 -r 5fdb1399c25fcd6c4ed7d663b026f5fc8b9c8c04 _pytest/assertion/rewrite.py --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -442,6 +442,13 @@ ast.NotIn: "not in" } +# Python 3.4+ compatibility +if hasattr(ast, "NameConstant"): + _NameConstant = ast.NameConstant +else: + def _NameConstant(c): + return ast.Name(str(c), ast.Load()) + def set_location(node, lineno, col_offset): """Set node location information recursively.""" @@ -680,7 +687,7 @@ if self.variables: variables = [ast.Name(name, ast.Store()) for name in self.variables] - clear = ast.Assign(variables, ast.Name("None", ast.Load())) + clear = ast.Assign(variables, _NameConstant(None)) self.statements.append(clear) # Fix line numbers. for stmt in self.statements: Repository URL: https://bitbucket.org/pytest-dev/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit