Issue #28512: Fixed setting the offset attribute of SyntaxError by

PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
This commit is contained in:
Serhiy Storchaka 2016-12-11 14:39:01 +02:00
parent 49c14d8e8f
commit 8b58339eb2
7 changed files with 56 additions and 58 deletions

View file

@ -240,8 +240,10 @@ class TestSupport(unittest.TestCase):
self.assertEqual(cm.exception.errno, errno.EBADF)
def test_check_syntax_error(self):
support.check_syntax_error(self, "def class")
support.check_syntax_error(self, "def class", lineno=1, offset=9)
self.assertRaises(AssertionError, support.check_syntax_error, self, "1")
#with self.assertRaises(AssertionError):
#support.check_syntax_error(self, "x=1")
def test_CleanImport(self):
import importlib