]> granicus.if.org Git - libevent/commitdiff
Don't accumulate arguments in `Entry.GetTranslation`
authorEnji Cooper <yaneurabeya@gmail.com>
Sat, 28 Mar 2020 00:24:53 +0000 (17:24 -0700)
committerEnji Cooper <yaneurabeya@gmail.com>
Sat, 28 Mar 2020 00:30:23 +0000 (17:30 -0700)
Initialize `extradict` safely to avoid accumulating arguments in dict
objects passed in across calls.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
event_rpcgen.py

index 590b4eb4929691f91ac404d9b5dbcf6685649274..8e9ed1fcc480ea98664205d52bce8b99510dae77 100755 (executable)
@@ -484,7 +484,9 @@ class Entry:
                 "around line %d" % (self._name, self.LineCount())
             )
 
-    def GetTranslation(self, extradict={}):
+    def GetTranslation(self, extradict=None):
+        if extradict is None:
+            extradict = {}
         mapping = {
             "parent_name": self._struct.Name(),
             "name": self._name,