From cfef1d74e757a69513769713de9ac4c92257237e Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 6 Jan 2020 00:02:26 +0100 Subject: [PATCH] Fix a Python 2.7 issue --- test/test_python_errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_python_errors.py b/test/test_python_errors.py index 846cf0f..10ecc7f 100644 --- a/test/test_python_errors.py +++ b/test/test_python_errors.py @@ -37,7 +37,8 @@ def test_python_exception_matches(code): error, = errors actual = error.message assert actual in wanted - assert line_nr == error.start_pos[0] + # Somehow in Python2.7 the SyntaxError().lineno is sometimes None + assert line_nr is None or line_nr == error.start_pos[0] def test_non_async_in_async():