Don't crash if not opened

svn: r23331
This commit is contained in:
Doug Blank 2013-10-17 16:02:55 +00:00
parent 27c5f4ffc5
commit e33642c412

View File

@ -436,7 +436,8 @@ class ImportOpenFileContextManager:
def __exit__(self, exc_type, exc_value, traceback): def __exit__(self, exc_type, exc_value, traceback):
if self.filename != '-': if self.filename != '-':
self.filehandle.close() if self.filehandle:
self.filehandle.close()
return False return False
def open_file(self, filename): def open_file(self, filename):