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,6 +436,7 @@ class ImportOpenFileContextManager:
def __exit__(self, exc_type, exc_value, traceback): def __exit__(self, exc_type, exc_value, traceback):
if self.filename != '-': if self.filename != '-':
if self.filehandle:
self.filehandle.close() self.filehandle.close()
return False return False