Don't crash if not opened
svn: r23331
This commit is contained in:
parent
27c5f4ffc5
commit
e33642c412
@ -436,7 +436,8 @@ class ImportOpenFileContextManager:
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
if self.filename != '-':
|
||||
self.filehandle.close()
|
||||
if self.filehandle:
|
||||
self.filehandle.close()
|
||||
return False
|
||||
|
||||
def open_file(self, filename):
|
||||
|
Loading…
Reference in New Issue
Block a user