diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-10-13 09:27:30 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-10-13 09:27:30 (GMT) |
commit | d4d60134b29290049e28df54f23493de4f1824b6 (patch) | |
tree | c6a08e45fead25f16ebadd4d6dff46a45ff9af5f /Lib/lib2to3/tests | |
parent | 0461704060474cb358d3495322950c4fd00616a0 (diff) | |
download | cpython-d4d60134b29290049e28df54f23493de4f1824b6.zip cpython-d4d60134b29290049e28df54f23493de4f1824b6.tar.gz cpython-d4d60134b29290049e28df54f23493de4f1824b6.tar.bz2 |
bpo-16965: 2to3 now rewrites execfile() to open with 'rb'. (GH-8569)
Diffstat (limited to 'Lib/lib2to3/tests')
-rw-r--r-- | Lib/lib2to3/tests/test_fixers.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/lib2to3/tests/test_fixers.py b/Lib/lib2to3/tests/test_fixers.py index 8cecf3c..3da5dd8 100644 --- a/Lib/lib2to3/tests/test_fixers.py +++ b/Lib/lib2to3/tests/test_fixers.py @@ -1201,36 +1201,36 @@ class Test_execfile(FixerTestCase): def test_conversion(self): b = """execfile("fn")""" - a = """exec(compile(open("fn").read(), "fn", 'exec'))""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob)""" self.check(b, a) b = """execfile("fn", glob, loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), glob, loc)""" self.check(b, a) b = """execfile("fn", globals=glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob)""" self.check(b, a) b = """execfile("fn", locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), locals=loc)""" self.check(b, a) b = """execfile("fn", globals=glob, locals=loc)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals=glob, locals=loc)""" self.check(b, a) def test_spacing(self): b = """execfile( "fn" )""" - a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))""" + a = """exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))""" self.check(b, a) b = """execfile("fn", globals = glob)""" - a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)""" + a = """exec(compile(open("fn", "rb").read(), "fn", 'exec'), globals = glob)""" self.check(b, a) |