diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-09-06 10:56:40 +0100 |
---|---|---|
committer | James Ennis <james.ennis@codethink.co.uk> | 2019-09-06 11:29:06 +0100 |
commit | d69f2324e6978b41106ae4bc63e75339e4f3f98f (patch) | |
tree | 291e263ae58e10b53c2146d31b58d2cf06b2909e /src/buildstream/_includes.py | |
parent | 04c0d417c26629df34b846363c7e18ab34d98981 (diff) | |
download | buildstream-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.py | 7 |
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() |