diff options
author | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-04-29 13:23:59 -0400 |
---|---|---|
committer | Doug Hellmann <doug.hellmann@dreamhost.com> | 2012-04-29 13:23:59 -0400 |
commit | 7e8e66adebfb2bc33da6f074abc54e9bb4fcff1e (patch) | |
tree | a52b648438543d75fee9fdd0cb923b1d1adbfc46 /cliff/app.py | |
parent | 20e8878663cfdb13778bcadd209f1bb9f4bbc41a (diff) | |
download | cliff-7e8e66adebfb2bc33da6f074abc54e9bb4fcff1e.tar.gz |
add tests for App and fix an issue with error handling and clean_up() in python 3.
Diffstat (limited to 'cliff/app.py')
-rw-r--r-- | cliff/app.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cliff/app.py b/cliff/app.py index 3d80710..3be4d60 100644 --- a/cliff/app.py +++ b/cliff/app.py @@ -197,7 +197,6 @@ class App(object): LOG.exception(err) raise LOG.error('ERROR: %s', err) - finally: try: self.clean_up(cmd, result, err) except Exception as err2: @@ -205,4 +204,12 @@ class App(object): LOG.exception(err2) else: LOG.error('Could not clean up: %s', err2) + else: + try: + self.clean_up(cmd, result, None) + except Exception as err3: + if self.options.debug: + LOG.exception(err3) + else: + LOG.error('Could not clean up: %s', err3) return result |