use RabitContext intead of init/finalize (#7911)

This commit is contained in:
Rong Ou
2022-05-16 21:15:41 -07:00
committed by GitHub
parent 4fcfd9c96e
commit 77d4a53c32
6 changed files with 137 additions and 153 deletions

View File

@@ -230,7 +230,9 @@ def version_number() -> int:
class RabitContext:
"""A context controlling rabit initialization and finalization."""
def __init__(self, args: List[bytes]) -> None:
def __init__(self, args: List[bytes] = None) -> None:
if args is None:
args = []
self.args = args
def __enter__(self) -> None: