summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-08-09 02:06:30 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2016-08-09 02:25:09 -0700
commit9d4a36a62f0ccd8cffc6fb96d6487f0805928e0b (patch)
tree06484d7a2db1820f69caa7cb3ee7b3b02044516c /lib
parent0c75c13cc0b26e10dd4c06cca24d597a18230f8c (diff)
downloadspack-9d4a36a62f0ccd8cffc6fb96d6487f0805928e0b.tar.gz
spack-9d4a36a62f0ccd8cffc6fb96d6487f0805928e0b.tar.bz2
spack-9d4a36a62f0ccd8cffc6fb96d6487f0805928e0b.tar.xz
spack-9d4a36a62f0ccd8cffc6fb96d6487f0805928e0b.zip
Properly re-raise exceptions from lock context handler.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/llnl/util/lock.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/lock.py b/lib/spack/llnl/util/lock.py
index bef20025ba..4a4aec2385 100644
--- a/lib/spack/llnl/util/lock.py
+++ b/lib/spack/llnl/util/lock.py
@@ -213,13 +213,15 @@ class LockTransaction(object):
return self._as
def __exit__(self, type, value, traceback):
+ suppress = False
if self._exit():
if self._as and hasattr(self._as, '__exit__'):
- self._as.__exit__(type, value, traceback)
+ if self._as.__exit__(type, value, traceback):
+ suppress = True
if self._release_fn:
- self._release_fn(type, value, traceback)
- if value:
- raise value
+ if self._release_fn(type, value, traceback):
+ suppress = True
+ return suppress
class ReadTransaction(LockTransaction):