aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2020-03-05 09:50:30 -0800
committerDylan Baker <dylan@pnwbakers.com>2020-03-05 09:58:52 -0800
commit06b1a317d26cbe2a1bd7a232dd9726590d0c0a48 (patch)
treea2adf1f707779f18e226bf39c34447d229e71758 /mesonbuild/interpreter.py
parent4d6ac91f950380d8262c13ce529ac0d6d8f6f4ba (diff)
downloadmeson-06b1a317d26cbe2a1bd7a232dd9726590d0c0a48.zip
meson-06b1a317d26cbe2a1bd7a232dd9726590d0c0a48.tar.gz
meson-06b1a317d26cbe2a1bd7a232dd9726590d0c0a48.tar.bz2
Make use of unholder
We have a lot of cases of code like: ```python if hasattr(var, 'held_object'): var = var.held_object` ``` replace that with the unholder function.
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 4c0807c..3374d26 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -3087,9 +3087,7 @@ external dependencies (including libraries) must go to "dependencies".''')
def program_from_file_for(self, for_machine, prognames, silent):
bins = self.environment.binaries[for_machine]
- for p in prognames:
- if hasattr(p, 'held_object'):
- p = p.held_object
+ for p in unholder(prognames):
if isinstance(p, mesonlib.File):
continue # Always points to a local (i.e. self generated) file.
if not isinstance(p, str):