From 86b07ef0aec07d2d5d1f85c861094be637fbf24d Mon Sep 17 00:00:00 2001 From: James Westman Date: Tue, 22 Nov 2022 11:38:00 -0600 Subject: [PATCH] Fix new mypy errors --- blueprintcompiler/errors.py | 2 +- blueprintcompiler/parse_tree.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blueprintcompiler/errors.py b/blueprintcompiler/errors.py index 70aea2a..e3bc787 100644 --- a/blueprintcompiler/errors.py +++ b/blueprintcompiler/errors.py @@ -141,7 +141,7 @@ class CompilerBugError(Exception): """ Emitted on assertion errors """ -def assert_true(truth: bool, message:str=None): +def assert_true(truth: bool, message: T.Optional[str]=None): if not truth: raise CompilerBugError(message) diff --git a/blueprintcompiler/parse_tree.py b/blueprintcompiler/parse_tree.py index bc36415..0e2644b 100644 --- a/blueprintcompiler/parse_tree.py +++ b/blueprintcompiler/parse_tree.py @@ -444,7 +444,7 @@ class Match(ParseNode): token = ctx.next_token() return str(token) == self.op - def expected(self, expect: str = None): + def expected(self, expect: T.Optional[str] = None): """ Convenience method for err(). """ if expect is None: return self.err(f"Expected '{self.op}'")