From f5b52246ed8a1191c3aa1da7d3c63bbe11aee020 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 2 Mar 2009 23:31:26 +0000 Subject: ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626 --- Lib/test/test_coding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/test/test_coding.py') 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 = {} -- cgit v1.2.1