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 13
13
import unittest
14
14
# StringIO was changed in python 3
15
15
try :
16
- from io import StringIO
17
- except ImportError :
18
16
from StringIO import StringIO
17
+ except ImportError :
18
+ from io import StringIO
19
19
20
20
import sc2reader
21
21
from sc2reader .exceptions import CorruptTrackerFileError
@@ -589,12 +589,12 @@ def test_65895(self):
589
589
590
590
def test_event_print (self ):
591
591
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 ()
598
598
599
599
600
600
class TestGameEngine (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments