mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 20:06:52 +08:00
Remove some Python 2 compatibility code. (#6624)
This commit is contained in:
@@ -272,14 +272,9 @@ class CaptureOutputAndError(object):
|
||||
"""
|
||||
|
||||
def __init__(self, captured_output_and_error):
|
||||
if sys.version_info >= (3, 0):
|
||||
import io
|
||||
self.output_buffer = io.StringIO()
|
||||
self.error_buffer = io.StringIO()
|
||||
else:
|
||||
import cStringIO
|
||||
self.output_buffer = cStringIO.StringIO()
|
||||
self.error_buffer = cStringIO.StringIO()
|
||||
import io
|
||||
self.output_buffer = io.StringIO()
|
||||
self.error_buffer = io.StringIO()
|
||||
self.captured_output_and_error = captured_output_and_error
|
||||
|
||||
def __enter__(self):
|
||||
|
||||
Reference in New Issue
Block a user