Skip to content

Commit 41ba177

Browse files
authored
Merge pull request python#53 from CharlieZhao95/pep701/test_eof
test_eof: Fix failed case `test_eof_with_line_continuation`
2 parents 87f9bfd + 22e7966 commit 41ba177

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_eof.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from test import support
55
from test.support import os_helper
66
from test.support import script_helper
7+
from test.support import warnings_helper
78
import unittest
89

910
class EOFTestCase(unittest.TestCase):
@@ -36,10 +37,11 @@ def test_EOFS_with_file(self):
3637
rc, out, err = script_helper.assert_python_failure(file_name)
3738
self.assertIn(b'unterminated triple-quoted string literal (detected at line 3)', err)
3839

40+
@warnings_helper.ignore_warnings(category=SyntaxWarning)
3941
def test_eof_with_line_continuation(self):
4042
expect = "unexpected EOF while parsing (<string>, line 1)"
4143
try:
42-
compile('"\\xhh" \\', '<string>', 'exec', dont_inherit=True)
44+
compile('"\\Xhh" \\', '<string>', 'exec')
4345
except SyntaxError as msg:
4446
self.assertEqual(str(msg), expect)
4547
else:

0 commit comments

Comments
 (0)