diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-02-08 15:43:39 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-02-25 23:08:23 +0200 |
commit | b8e4600bb84c94c1efde93c186eba7a2f5305836 (patch) | |
tree | bf42f91e452b14ccda6a45054020e1ae8458a496 /mesonbuild | |
parent | cef5cab23c6fb53e4ddf0d2460cb2258ef64f6d5 (diff) | |
download | meson-b8e4600bb84c94c1efde93c186eba7a2f5305836.zip meson-b8e4600bb84c94c1efde93c186eba7a2f5305836.tar.gz meson-b8e4600bb84c94c1efde93c186eba7a2f5305836.tar.bz2 |
interpreterbase: fix ObjectHolder
There are two problems:
1. It doesn't take the generic type as a parameter
2. it sets subpproject to None, but expects to always get a string
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/interpreterbase.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py index e924e93..376f8b0 100644 --- a/mesonbuild/interpreterbase.py +++ b/mesonbuild/interpreterbase.py @@ -60,9 +60,9 @@ class InterpreterObject: TV_InterpreterObject = T.TypeVar('TV_InterpreterObject') class ObjectHolder(T.Generic[TV_InterpreterObject]): - def __init__(self, obj: InterpreterObject, subproject: T.Optional[str] = None) -> None: - self.held_object = obj # type: InterpreterObject - self.subproject = subproject # type: str + def __init__(self, obj: TV_InterpreterObject, subproject: str = '') -> None: + self.held_object = obj + self.subproject = subproject def __repr__(self) -> str: return '<Holder: {!r}>'.format(self.held_object) |