diff options
| author | Marko Kreen | 2013-06-19 21:17:26 +0000 |
|---|---|---|
| committer | Marko Kreen | 2013-06-19 21:17:26 +0000 |
| commit | 9d2b2d30a1736548d40f17eff5f9f05faa32aaf1 (patch) | |
| tree | be947d1c90b61fa139bf765e5486650f960ac8fe /python/skytools | |
| parent | 609617c369cc5ad740ad1fa5c90a56a66d2da762 (diff) | |
| parent | 26be6819f4ecc80b7d01db3bfd4933ec1d02115a (diff) | |
Merge remote-tracking branch 'gamato/develop'
Diffstat (limited to 'python/skytools')
| -rw-r--r-- | python/skytools/gzlog.py | 7 | ||||
| -rw-r--r-- | python/skytools/scripting.py | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/python/skytools/gzlog.py b/python/skytools/gzlog.py index 558e2813..0db40fc3 100644 --- a/python/skytools/gzlog.py +++ b/python/skytools/gzlog.py @@ -1,8 +1,8 @@ """Atomic append of gzipped data. -The point is - if several gzip streams are concated, they -are read back as one whose stream. +The point is - if several gzip streams are concatenated, +they are read back as one whole stream. """ import gzip @@ -22,7 +22,7 @@ def gzip_append(filename, data, level = 6): g.write(data) g.close() zdata = buf.getvalue() - + # append, safely f = open(filename, "a+", 0) f.seek(0, 2) @@ -36,4 +36,3 @@ def gzip_append(filename, data, level = 6): f.truncate() f.close() raise ex - diff --git a/python/skytools/scripting.py b/python/skytools/scripting.py index a5e82663..840f3cf4 100644 --- a/python/skytools/scripting.py +++ b/python/skytools/scripting.py @@ -588,7 +588,10 @@ class BaseScript(object): self.reset() sys.exit(1) except Exception, d: - self.send_stats() + try: # this may fail too + self.send_stats() + except: + pass emsg = str(d).rstrip() self.reset() self.exception_hook(d, emsg) |
