Python 2 compatibility. (#5887)

This commit is contained in:
Robert Nishihara
2019-10-10 19:09:25 -07:00
committed by GitHub
parent c3b2ae26c5
commit 523c764c25
12 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -354,7 +354,7 @@ class NodeLauncher(threading.Thread):
logger.info(prefix + " {}".format(statement))
class ConcurrentCounter():
class ConcurrentCounter(object):
def __init__(self):
self._value = 0
self._lock = threading.Lock()
+1 -1
View File
@@ -8,7 +8,7 @@ import logging
logger = logging.getLogger(__name__)
class LogTimer():
class LogTimer(object):
def __init__(self, message):
self._message = message
@@ -9,7 +9,7 @@ from ray.experimental.serve.metric import MetricMonitor
@pytest.fixture(scope="session")
def start_target_actor(ray_instance):
@ray.remote
class Target():
class Target(object):
def __init__(self):
self.counter_value = 0
+1 -1
View File
@@ -41,7 +41,7 @@ def log_sync_template():
).format(ssh_key=quote(ssh_key))
class NodeSyncMixin():
class NodeSyncMixin(object):
"""Mixin for syncing files to/from a remote dir to a local dir."""
def __init__(self):
+1 -1
View File
@@ -294,7 +294,7 @@ class HyperBandScheduler(FIFOScheduler):
trial_runner.trial_executor.unpause_trial(trial)
class Bracket():
class Bracket(object):
"""Logical object for tracking Hyperband bracket progress. Keeps track
of proper parameters as designated by HyperBand.
+1 -1
View File
@@ -20,7 +20,7 @@ from ray.tune import commands
from ray.tune.result import CONFIG_PREFIX
class Capturing():
class Capturing(object):
def __enter__(self):
self._stdout = sys.stdout
sys.stdout = self._stringio = StringIO()