diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-03-05 09:50:30 -0800 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-03-05 09:58:52 -0800 |
commit | 06b1a317d26cbe2a1bd7a232dd9726590d0c0a48 (patch) | |
tree | a2adf1f707779f18e226bf39c34447d229e71758 /mesonbuild/modules/windows.py | |
parent | 4d6ac91f950380d8262c13ce529ac0d6d8f6f4ba (diff) | |
download | meson-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/modules/windows.py')
-rw-r--r-- | mesonbuild/modules/windows.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index 7cf46f7..8589adc 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -18,7 +18,7 @@ import re from .. import mlog from .. import mesonlib, build -from ..mesonlib import MachineChoice, MesonException, extract_as_list +from ..mesonlib import MachineChoice, MesonException, extract_as_list, unholder from . import get_include_args from . import ModuleReturnValue from . import ExtensionModule @@ -116,9 +116,7 @@ class WindowsModule(ExtensionModule): for subsrc in src: add_target(subsrc) return - - if hasattr(src, 'held_object'): - src = src.held_object + src = unholder(src) if isinstance(src, str): name_format = 'file {!r}' |