From b308adc3af939b27bd18941710b4499b1131e090 Mon Sep 17 00:00:00 2001 From: James Westman Date: Thu, 15 Aug 2024 18:28:29 -0500 Subject: [PATCH] Remove backslash from f-string expression This restriction was removed in Python 3.12, but plenty of users still have older versions. --- blueprintcompiler/decompiler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blueprintcompiler/decompiler.py b/blueprintcompiler/decompiler.py index 845a88d..3048d32 100644 --- a/blueprintcompiler/decompiler.py +++ b/blueprintcompiler/decompiler.py @@ -141,7 +141,8 @@ class DecompileCtx: val = truthy(value) self.print("true" if val else "false") elif type.assignable_to(ArrayType(StringType())): - self.print(f"[{', '.join([escape_quote(x) for x in value.split('\n')])}]") + items = ", ".join([escape_quote(x) for x in value.split("\n")]) + self.print(f"[{items}]") elif ( type.assignable_to(self.gir.namespaces["Gtk"].lookup_type("Gdk.Pixbuf")) or type.assignable_to(self.gir.namespaces["Gtk"].lookup_type("Gdk.Texture"))