summaryrefslogtreecommitdiff
path: root/src/buildstream/_includes.py
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-09-06 10:56:40 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-09-06 11:29:06 +0100
commitd69f2324e6978b41106ae4bc63e75339e4f3f98f (patch)
tree291e263ae58e10b53c2146d31b58d2cf06b2909e /src/buildstream/_includes.py
parent04c0d417c26629df34b846363c7e18ab34d98981 (diff)
downloadbuildstream-d69f2324e6978b41106ae4bc63e75339e4f3f98f.tar.gz
Address no-else-raise pylint warning
In the latest released version of pylint (2.3.x), the "no-else-raise" (R1720) warning has been introduced. See: http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-3-0 There are many instances of this in our codebase, which this patch addresses.
Diffstat (limited to 'src/buildstream/_includes.py')
-rw-r--r--src/buildstream/_includes.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/buildstream/_includes.py b/src/buildstream/_includes.py
index 0ba40e63d..c04601b91 100644
--- a/src/buildstream/_includes.py
+++ b/src/buildstream/_includes.py
@@ -58,12 +58,13 @@ class Includes:
message = "{}: Include block references a file that could not be found: '{}'.".format(
include_provenance, include)
raise LoadError(message, LoadErrorReason.MISSING_FILE) from e
- elif e.reason == LoadErrorReason.LOADING_DIRECTORY:
+ if e.reason == LoadErrorReason.LOADING_DIRECTORY:
message = "{}: Include block references a directory instead of a file: '{}'.".format(
include_provenance, include)
raise LoadError(message, LoadErrorReason.LOADING_DIRECTORY) from e
- else:
- raise
+
+ # Otherwise, we don't know the reason, so just raise
+ raise
if file_path in included:
include_provenance = includes_node.get_provenance()