mirror of
https://github.com/microsoft/autogen.git
synced 2025-12-28 07:29:54 +00:00
None type object cannot call close (#143)
* Fix AttributeError in file.close
This commit is contained in:
parent
eeaf5b5963
commit
68733314f3
@ -117,7 +117,8 @@ class TrainingLogWriter(object):
|
||||
self.file.flush()
|
||||
|
||||
def close(self):
|
||||
self.file.close()
|
||||
if self.file is not None:
|
||||
self.file.close()
|
||||
self.file = None # for pickle
|
||||
|
||||
|
||||
@ -141,7 +142,8 @@ class TrainingLogReader(object):
|
||||
yield TrainingLogRecord(**data)
|
||||
|
||||
def close(self):
|
||||
self.file.close()
|
||||
if self.file is not None:
|
||||
self.file.close()
|
||||
self.file = None # for pickle
|
||||
|
||||
def get_record(self, record_id) -> TrainingLogRecord:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user