Skip to content

Commit

Permalink
Add assertion to aid type checking.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 568244870
Change-Id: I66cac69883a9857a3177a8710249e66987683941
  • Loading branch information
Acme Contributor authored and copybara-github committed Sep 25, 2023
1 parent 74a841a commit 32009e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions acme/utils/loggers/auto_close.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def __init__(self, logger: base.Logger):
self._finalizer = weakref.finalize(self, logger.close)

def write(self, values: base.LoggingData):
if self._logger is None:
raise ValueError('init not called')
self._logger.write(values)

def close(self):
Expand Down

0 comments on commit 32009e2

Please sign in to comment.