diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2021-09-19 01:31:25 -0500 |
---|---|---|
committer | Matthew Peveler <matt.peveler@popsql.com> | 2021-09-18 20:33:12 -1000 |
commit | 21c21d4fd11d2b419fe9090b17a5c8cc1eefd162 (patch) | |
tree | bd85abae833ec4ee471ac0cff44b193e509d6a65 | |
parent | 46c82c251e27caac659cfc18beedd9e9e965db9d (diff) | |
download | asciidoc-py3-21c21d4fd11d2b419fe9090b17a5c8cc1eefd162.tar.gz |
Cleanup outfile on system-exiting exceptions (#195)
-rwxr-xr-x | asciidoc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/asciidoc.py b/asciidoc.py index 2d22c4d..7f058a2 100755 --- a/asciidoc.py +++ b/asciidoc.py @@ -6251,12 +6251,12 @@ def asciidoc(backend, doctype, confiles, infile, outfile, options): writer.close() finally: reader.closefile() - except KeyboardInterrupt: - raise - except Exception as e: + except BaseException as e: # Cleanup. if outfile and outfile != '<stdout>' and os.path.isfile(outfile): os.unlink(outfile) + if not isinstance(e, Exception): + raise # Build and print error description. msg = 'FAILED: ' if reader.cursor: |