summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2018-12-12 15:12:47 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2018-12-13 12:05:15 +0000
commit180fa7745e486ecf3c94b387419523d6b2f81c80 (patch)
treed6b2a0b94955e5e691870393b5cdf3aac66ccd35
parenta116f576fa0c69a4fb28ba020b89ec13b11e4717 (diff)
downloadbuildstream-180fa7745e486ecf3c94b387419523d6b2f81c80.tar.gz
element.py: fix unbounded variable in nested python exception
As per https://docs.python.org/3.7/reference/compound_stmts.html#except variables used in the "except" clause are erased at the end of the block. We had a conflict with a nested exception using the same variable as before. This renames the nested variable to avoid the clash
-rw-r--r--buildstream/element.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index ed279458c..918323a2f 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1612,9 +1612,9 @@ class Element(Plugin):
sandbox_vpath = sandbox_vroot.descend(path_components)
try:
sandbox_vpath.import_files(workspace.get_absolute_path())
- except UtilError as e:
+ except UtilError as e2:
self.warn("Failed to preserve workspace state for failed build sysroot: {}"
- .format(e))
+ .format(e2))
self.__set_build_result(success=False, description=str(e), detail=e.detail)
self._cache_artifact(rootdir, sandbox, e.collect)