mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Merge with 3.3
This commit is contained in:
commit
78f1e4c865
5 changed files with 30 additions and 2 deletions
|
@ -5,6 +5,7 @@ from test.support import TESTFN, unlink, unload
|
|||
import importlib
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
class SourceEncodingTest(unittest.TestCase):
|
||||
|
||||
|
@ -58,6 +59,14 @@ class SourceEncodingTest(unittest.TestCase):
|
|||
# two bytes in common with the UTF-8 BOM
|
||||
self.assertRaises(SyntaxError, eval, b'\xef\xbb\x20')
|
||||
|
||||
def test_20731(self):
|
||||
sub = subprocess.Popen([sys.executable,
|
||||
os.path.join(os.path.dirname(__file__),
|
||||
'coding20731.py')],
|
||||
stderr=subprocess.PIPE)
|
||||
err = sub.communicate()[1]
|
||||
self.assertEquals(err, b'')
|
||||
|
||||
def test_error_message(self):
|
||||
compile(b'# -*- coding: iso-8859-15 -*-\n', 'dummy', 'exec')
|
||||
compile(b'\xef\xbb\xbf\n', 'dummy', 'exec')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue