mavsdk_tests: prevent exception if log_fd is None

This commit is contained in:
Julian Oes 2020-05-20 15:15:39 +02:00
parent 262341455b
commit a1bf1bdd9d
1 changed files with 3 additions and 2 deletions

View File

@ -134,7 +134,7 @@ class Tester:
self.gui = gui
self.verbose = verbose
self.start_time = datetime.datetime.now()
self.combined_log_fd = TextIO
self.log_fd: Any[TextIO] = None
@classmethod
def determine_tests(cls,
@ -456,6 +456,7 @@ class Tester:
self.log_fd = open(filename, 'w')
def stop_combined_log(self) -> None:
if self.log_fd:
self.log_fd.close()
def add_to_combined_log(self, output: str) -> None: