From 09b53c534f74806ebc49bb2fcdfbae0e3b26fb84 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Mon, 6 Jan 2020 15:27:38 +0100 Subject: types: import typing as T (fixes #6333) --- tools/cmake2meson.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tools/cmake2meson.py') diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py index 07ff3c9..5a27a51 100755 --- a/tools/cmake2meson.py +++ b/tools/cmake2meson.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import typing +import typing as T from pathlib import Path import sys import re @@ -47,7 +47,7 @@ class Lexer: ('rparen', re.compile(r'\)')), ] - def lex(self, code: str) -> typing.Iterator[Token]: + def lex(self, code: str) -> T.Iterator[Token]: lineno = 1 line_start = 0 loc = 0 @@ -135,7 +135,7 @@ class Parser: args += rest return args - def parse(self) -> typing.Iterator[Statement]: + def parse(self) -> T.Iterator[Statement]: while not self.accept('eof'): yield(self.statement()) @@ -148,9 +148,9 @@ class Converter: self.cmake_root = Path(cmake_root).expanduser() self.indent_unit = ' ' self.indent_level = 0 - self.options = [] # type: typing.List[tuple] + self.options = [] # type: T.List[tuple] - def convert_args(self, args: typing.List[Token], as_array: bool = True) -> str: + def convert_args(self, args: T.List[Token], as_array: bool = True) -> str: res = [] if as_array: start = '[' @@ -173,7 +173,7 @@ class Converter: return res[0] return '' - def write_entry(self, outfile: typing.TextIO, t: Statement): + def write_entry(self, outfile: T.TextIO, t: Statement): if t.name in Converter.ignored_funcs: return preincrement = 0 -- cgit v1.1