@@ -1143,36 +1143,36 @@ class Test_execfile(FixerTestCase):
1143
1143
1144
1144
def test_conversion (self ):
1145
1145
b = """execfile("fn")"""
1146
- a = """exec(compile(open("fn").read(), "fn", 'exec'))"""
1146
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'))"""
1147
1147
self .check (b , a )
1148
1148
1149
1149
b = """execfile("fn", glob)"""
1150
- a = """exec(compile(open("fn").read(), "fn", 'exec'), glob)"""
1150
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'), glob)"""
1151
1151
self .check (b , a )
1152
1152
1153
1153
b = """execfile("fn", glob, loc)"""
1154
- a = """exec(compile(open("fn").read(), "fn", 'exec'), glob, loc)"""
1154
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'), glob, loc)"""
1155
1155
self .check (b , a )
1156
1156
1157
1157
b = """execfile("fn", globals=glob)"""
1158
- a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob)"""
1158
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'), globals=glob)"""
1159
1159
self .check (b , a )
1160
1160
1161
1161
b = """execfile("fn", locals=loc)"""
1162
- a = """exec(compile(open("fn").read(), "fn", 'exec'), locals=loc)"""
1162
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'), locals=loc)"""
1163
1163
self .check (b , a )
1164
1164
1165
1165
b = """execfile("fn", globals=glob, locals=loc)"""
1166
- a = """exec(compile(open("fn").read(), "fn", 'exec'), globals=glob, locals=loc)"""
1166
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'), globals=glob, locals=loc)"""
1167
1167
self .check (b , a )
1168
1168
1169
1169
def test_spacing (self ):
1170
1170
b = """execfile( "fn" )"""
1171
- a = """exec(compile(open( "fn" ).read(), "fn", 'exec'))"""
1171
+ a = """exec(compile(open( "fn", "rb" ).read(), "fn", 'exec'))"""
1172
1172
self .check (b , a )
1173
1173
1174
1174
b = """execfile("fn", globals = glob)"""
1175
- a = """exec(compile(open("fn").read(), "fn", 'exec'), globals = glob)"""
1175
+ a = """exec(compile(open("fn", "rb" ).read(), "fn", 'exec'), globals = glob)"""
1176
1176
self .check (b , a )
1177
1177
1178
1178
0 commit comments