From fa2df3889c4ced83d39ea60eacf0d48f17edb699 Mon Sep 17 00:00:00 2001 From: apalala Date: Tue, 4 Jun 2024 09:31:50 -0400 Subject: [PATCH] [lint] resolve warnings for updated ruff --- ruff.toml | 1 + tatsu/contexts.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ruff.toml b/ruff.toml index c3f748b7..abf3684a 100644 --- a/ruff.toml +++ b/ruff.toml @@ -15,6 +15,7 @@ lint.ignore = [ "E741", # ambiguous-variable-name "E402", # module-import-not-at-top-of-file "S101", # use of assert + "PERF203", # try-except within loop "PLC0415", # import-outside-top-level "PLR6301", # no-self-use "PLR0904", # too-many-public-methods diff --git a/tatsu/contexts.py b/tatsu/contexts.py index 6143466f..50d7df30 100644 --- a/tatsu/contexts.py +++ b/tatsu/contexts.py @@ -739,7 +739,7 @@ def _constant(self, literal): except (ValueError, SyntaxError): if '\n' in literal: literal = trim(literal) - literal = eval( # noqa: S307, PGH001 + literal = eval( # noqa: S307 f'{"f" + repr(literal)}', {}, self.ast, ) self._append_cst(literal)