diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-02 23:31:26 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-02 23:31:26 +0000 |
commit | d9a6e17352a6d8e333c4782718cc99aec6d536e6 (patch) | |
tree | 25e0b7853076a58617b90f14754351cab385f967 /Lib/test/test_coding.py | |
parent | 52b65a6a6818d27707d31495a00b01391378ab11 (diff) | |
download | cpython-d9a6e17352a6d8e333c4782718cc99aec6d536e6.tar.gz |
ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626
Diffstat (limited to 'Lib/test/test_coding.py')
-rw-r--r-- | Lib/test/test_coding.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py index ade8bdfde9..51873b40de 100644 --- a/Lib/test/test_coding.py +++ b/Lib/test/test_coding.py @@ -17,10 +17,10 @@ class CodingTest(unittest.TestCase): path = os.path.dirname(__file__) filename = os.path.join(path, module_name + '.py') - fp = open(filename, encoding='utf-8') - text = fp.read() + fp = open(filename, "rb") + bytes = fp.read() fp.close() - self.assertRaises(SyntaxError, compile, text, filename, 'exec') + self.assertRaises(SyntaxError, compile, bytes, filename, 'exec') def test_exec_valid_coding(self): d = {} |