From 803145e267a3b6ffba7eb64be3ebd7c57d77d565 Mon Sep 17 00:00:00 2001 From: SaNeOr <534369503@qq.com> Date: Thu, 15 Jun 2023 16:46:27 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?python=E6=95=B0=E6=8D=AE,=20DMap=E7=B1=BB=E5=9E=8B=20key?= =?UTF-8?q?=E7=9A=84=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98=20(#49)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit python的dict类型key不像json只能为string,还可能为其他类型。 --- src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs b/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs index e332dec..686ad56 100644 --- a/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs +++ b/src/Luban.Job.Cfg/Source/DataVisitors/ToPythonLiteralVisitor.cs @@ -94,7 +94,7 @@ namespace Luban.Job.Cfg.DataVisitors x.Append(','); } ++index; - x.Append('"').Append(e.Key.ToString()).Append('"'); + x.Append(e.Key.Apply(this)); x.Append(':'); x.Append(e.Value.Apply(this)); }