diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-02 23:31:26 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-02 23:31:26 (GMT) |
commit | f5b52246ed8a1191c3aa1da7d3c63bbe11aee020 (patch) | |
tree | dcac9a1daca7f583ff958cb61f73e9ed11b5564b /Lib/test/test_coding.py | |
parent | 0663a1ed793c164fb11d3dd62bebc677e260891e (diff) | |
download | cpython-f5b52246ed8a1191c3aa1da7d3c63bbe11aee020.zip cpython-f5b52246ed8a1191c3aa1da7d3c63bbe11aee020.tar.gz cpython-f5b52246ed8a1191c3aa1da7d3c63bbe11aee020.tar.bz2 |
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 ade8bdf..51873b4 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 = {} |