From 52e6fdb860bf9912eb297dbbb272d9223dd68399 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sat, 20 May 2023 18:54:48 +0800 Subject: [PATCH] ... --- python/_set.py | 2 +- src/pocketpy.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/_set.py b/python/_set.py index 934f4c27..99ebbec5 100644 --- a/python/_set.py +++ b/python/_set.py @@ -95,4 +95,4 @@ class set: return '{'+ ', '.join([repr(i) for i in self._a.keys()]) + '}' def __iter__(self): - return self._a.keys() \ No newline at end of file + return iter(self._a.keys()) \ No newline at end of file diff --git a/src/pocketpy.h b/src/pocketpy.h index 2a2d6471..ed958a60 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -897,7 +897,7 @@ inline void init_builtins(VM* _vm) { for(auto& item : self.items()){ if(!first) ss << ", "; first = false; - Str key = CAST(Str&, item.first); + Str key = CAST(Str&, item.first).escape(); Str value = CAST(Str&, vm->py_json(item.second)); ss << key << ": " << value; }