File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1313 import unittest
1414# StringIO was changed in python 3
1515try :
16- from io import StringIO
17- except ImportError :
1816 from StringIO import StringIO
17+ except ImportError :
18+ from io import StringIO
1919
2020import sc2reader
2121from sc2reader .exceptions import CorruptTrackerFileError
@@ -589,12 +589,12 @@ def test_65895(self):
589589
590590 def test_event_print (self ):
591591 replay = sc2reader .load_replay ("test_replays/lotv/lotv1.SC2Replay" )
592- with StringIO () as capturedOutput :
593- sys . stdout = capturedOutput
594- for event in replay . events :
595- print ( event )
596- self . assertIn ( "PlayerLeaveEvent" , capturedOutput . getvalue ())
597- sys . stdout = sys . __stdout__
592+ sys . stdout = capturedOutput = StringIO ()
593+ for event in replay . events :
594+ print ( event )
595+ self . assertIn ( "PlayerLeaveEvent" , capturedOutput . getvalue () )
596+ sys . stdout = sys . __stdout__
597+ capturedOutput . close ()
598598
599599
600600class TestGameEngine (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments