@@ -268,20 +268,20 @@ def __coerce__(self, other):
268268 self .assertRaises (OverflowError , coerce , 0.5 , int ("12345" * 1000 ))
269269
270270 def test_compile (self ):
271- compile ('print 1 \n ' , '' , 'exec' )
271+ compile ('print(1) \n ' , '' , 'exec' )
272272 bom = '\xef \xbb \xbf '
273- compile (bom + 'print 1 \n ' , '' , 'exec' )
273+ compile (bom + 'print(1) \n ' , '' , 'exec' )
274274 compile (source = 'pass' , filename = '?' , mode = 'exec' )
275275 compile (dont_inherit = 0 , filename = 'tmp' , source = '0' , mode = 'eval' )
276276 compile ('pass' , '?' , dont_inherit = 1 , mode = 'exec' )
277277 self .assertRaises (TypeError , compile )
278- self .assertRaises (ValueError , compile , 'print 42 \n ' , '<string>' , 'badmode' )
279- self .assertRaises (ValueError , compile , 'print 42 \n ' , '<string>' , 'single' , 0xff )
278+ self .assertRaises (ValueError , compile , 'print(42) \n ' , '<string>' , 'badmode' )
279+ self .assertRaises (ValueError , compile , 'print(42) \n ' , '<string>' , 'single' , 0xff )
280280 self .assertRaises (TypeError , compile , chr (0 ), 'f' , 'exec' )
281281 self .assertRaises (TypeError , compile , 'pass' , '?' , 'exec' ,
282282 mode = 'eval' , source = '0' , filename = 'tmp' )
283283 if True : # Was: if have_unicode:
284- compile (unicode ('print u"\xc3 \xa5 "\n ' , 'utf8' ), '' , 'exec' )
284+ compile (unicode ('print( u"\xc3 \xa5 "\n ) ' , 'utf8' ), '' , 'exec' )
285285 self .assertRaises (TypeError , compile , unichr (0 ), 'f' , 'exec' )
286286 self .assertRaises (ValueError , compile , unicode ('a = 1' ), 'f' , 'bad' )
287287
@@ -484,8 +484,7 @@ def keys(self):
484484 if True :
485485 # with check_py3k_warnings(("execfile.. not supported in 3.x",
486486 # DeprecationWarning)):
487- # execfile(TESTFN)
488- pass
487+ execfile (TESTFN )
489488
490489 def test_execfile (self ):
491490 global numruns
@@ -988,9 +987,9 @@ def gen():
988987
989988 def test_oct (self ):
990989 self .assertEqual (oct (100 ), '0144' )
991- self .assertEqual (oct (100 ), '0144L' )
990+ # self.assertEqual(oct(100L ), '0144L')
992991 self .assertEqual (oct (- 100 ), '-0144' )
993- self .assertEqual (oct (- 100 ), '-0144L' )
992+ # self.assertEqual(oct(-100L ), '-0144L')
994993 self .assertRaises (TypeError , oct , ())
995994
996995 def write_testfile (self ):
@@ -1235,12 +1234,12 @@ def test_input_and_raw_input(self):
12351234 # SF 876178: make sure input() respect future options.
12361235 sys .stdin = io .BytesIO (b'1/2' )
12371236 sys .stdout = io .BytesIO ()
1238- exec (compile ('print input()' , 'test_builtin_tmp' , 'exec' ))
1237+ exec (compile ('print( input() )' , 'test_builtin_tmp' , 'exec' ))
12391238 sys .stdin .seek (0 , 0 )
1240- exec (compile ('from __future__ import division;print input()' ,
1239+ exec (compile ('from __future__ import division;print( input() )' ,
12411240 'test_builtin_tmp' , 'exec' ))
12421241 sys .stdin .seek (0 , 0 )
1243- exec (compile ('print input()' , 'test_builtin_tmp' , 'exec' ))
1242+ exec (compile ('print( input() )' , 'test_builtin_tmp' , 'exec' ))
12441243 # The result we expect depends on whether new division semantics
12451244 # are already in effect.
12461245 if 1 / 2 == 0 :
0 commit comments