diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2019-04-30 12:52:37 -0700 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-02 23:38:36 +0300 |
| commit | edb1229a48a4009bde5e04c5324ef86f1e2957bb (patch) | |
| tree | c7b21c4fe28ac692ae6a02d0e787e5a1c9e25a1f /mesonbuild/mesonlib.py | |
| parent | 1f4023fa47803458700e52352dec51f3f85fa6c1 (diff) | |
| download | meson-edb1229a48a4009bde5e04c5324ef86f1e2957bb.tar.gz | |
mesonlib: Make a few type annotations strings
Mypy know what to do with these and isn't confused, but some versions of
python 3.5 (at least 3.5.2) can't handle these annotations. By making
them strings the python interpreter wont try to evaluate them.
Fixes #5326
Diffstat (limited to 'mesonbuild/mesonlib.py')
| -rw-r--r-- | mesonbuild/mesonlib.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib.py b/mesonbuild/mesonlib.py index aaaf14407..f78fa352f 100644 --- a/mesonbuild/mesonlib.py +++ b/mesonbuild/mesonlib.py @@ -920,7 +920,8 @@ def extract_as_list(dict_object, *keys, pop=False, **kwargs): result.append(listify(fetch(key, []), **kwargs)) return result -def typeslistify(item: typing.Union[_T, typing.List[_T]], types: typing.Union[typing.Type[_T], typing.Tuple[typing.Type[_T]]]) -> typing.List[_T]: +def typeslistify(item: 'typing.Union[_T, typing.List[_T]]', + types: 'typing.Union[typing.Type[_T], typing.Tuple[typing.Type[_T]]]') -> typing.List[_T]: ''' Ensure that type(@item) is one of @types or a list of items all of which are of type @types |
