Don't puke when exiting driver list

When you run the generate_driver_list.py file from inside the
tools dir, it pukes out an AttributeError for NoneType object
has no attribute 'close'.  This patch makes sure that exiting
doesn't cause a puke.

Change-Id: Ib6c4f451096cd07d0423941cab52ffa8cd8dc471
This commit is contained in:
Walter A. Boring IV 2016-08-02 06:56:57 -07:00
parent b7860e3afc
commit c28cd113be

View File

@ -37,7 +37,8 @@ class Output(object):
return self
def __exit__(self, type, value, traceback):
self.driver_file.close()
if self.driver_file:
self.driver_file.close()
def write(self, text):
if self.driver_file: