From 312f4cd1256eecf227b8650c6c278c751f6ecff9 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Thu, 20 Mar 2025 21:36:13 +0100 Subject: [PATCH] Fixing variable name not showing when error --- modules/Variables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/Variables.py b/modules/Variables.py index dd3f7f6..bfa406d 100644 --- a/modules/Variables.py +++ b/modules/Variables.py @@ -49,19 +49,19 @@ class Variables: self.trace = trace def get(self, name): - assert name in self.variables, "la variable {name} n'éxiste pas" + assert name in self.variables, f"la variable {name} n'éxiste pas" if self.trace: print(f"{trace_format}accède {name}{reset_format}", file=sys.stderr) return self.variables[name].value def declare(self, typ, name, value=None): - assert name not in self.variables, "la variable {name} existe déjà" + assert name not in self.variables, f"la variable {name} existe déjà" self.variables[name] = self.Variable(typ, value) if self.trace: print(f"{trace_format}déclare {name} = {value}{reset_format}", file=sys.stderr) def assign(self, name, value): - assert name in self.variables, "la variable n'éxiste pas" + assert name in self.variables, f"la variable n'éxiste pas" self.variables[name].set(value) if self.trace: print(f"{trace_format}modifie {name} = {value}{reset_format}", file=sys.stderr)