diff options
author | Benjamin Schubert <bschubert15@bloomberg.net> | 2019-12-02 11:02:23 +0000 |
---|---|---|
committer | Benjamin Schubert <bschubert15@bloomberg.net> | 2019-12-02 11:02:23 +0000 |
commit | 069b110c866ecfd652a041d735ca6d261b8d41ba (patch) | |
tree | 8971bdb7d0c26ce7e5d2da65e705b1046c666603 /src | |
parent | 05aaf3eadff2981fe3c16e6c3a808c37f0ca1187 (diff) | |
download | buildstream-069b110c866ecfd652a041d735ca6d261b8d41ba.tar.gz |
lint: Remove unnecessary list comprehensions
Newer version of pylint detect when a comprehension would not be needed.
Let's remove all the ones that are indeed extraneous
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/_profile.py | 2 | ||||
-rw-r--r-- | src/buildstream/_stream.py | 2 | ||||
-rw-r--r-- | src/buildstream/element.py | 2 | ||||
-rw-r--r-- | src/buildstream/source.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/buildstream/_profile.py b/src/buildstream/_profile.py index fdde04ab7..b3182b630 100644 --- a/src/buildstream/_profile.py +++ b/src/buildstream/_profile.py @@ -118,7 +118,7 @@ class _Profiler: self._valid_topics = False if settings: - self.enabled_topics = {topic for topic in settings.split(":")} + self.enabled_topics = set(settings.split(":")) @contextlib.contextmanager def profile(self, topic, key, message=None): diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 4b8409323..20e073110 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -678,7 +678,7 @@ class Stream: continue if isinstance(obj, ArtifactElement): obj.name = ref - files = [f for f in obj._walk_artifact_files()] + files = list(obj._walk_artifact_files()) elements_to_files[obj.name] = files return elements_to_files diff --git a/src/buildstream/element.py b/src/buildstream/element.py index ffce257bf..7b96e8a8b 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -1965,7 +1965,7 @@ class Element(Plugin): sandbox._set_mount_source(mount.path, mount.host_path) if command: - argv = [arg for arg in command] + argv = command else: argv = shell_command diff --git a/src/buildstream/source.py b/src/buildstream/source.py index dbe113409..f49cdb493 100644 --- a/src/buildstream/source.py +++ b/src/buildstream/source.py @@ -1004,7 +1004,7 @@ class Source(Plugin): # If we're synthesising missing list entries, we know we're # doing this for project.refs so synthesise empty dicts for the # intervening entries too - lpath = [step for step in path] + lpath = path.copy() lpath.append("") # We know the last step will be a string key for step, next_step in zip(lpath, lpath[1:]): if type(step) is str: # pylint: disable=unidiomatic-typecheck |