Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xexamples/6_Maths_matchingAnglesAndShapes/js/mo2js.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/6_Maths_matchingAnglesAndShapes/js/mo2js.py b/examples/6_Maths_matchingAnglesAndShapes/js/mo2js.py
index f2804eb..24fd492 100755
--- a/examples/6_Maths_matchingAnglesAndShapes/js/mo2js.py
+++ b/examples/6_Maths_matchingAnglesAndShapes/js/mo2js.py
@@ -54,9 +54,7 @@ def store_translation(dictionary, key, translation):
p = path(key)
while len(p) > 1:
x = p.pop(0)
- if x not in dictionary:
- dictionary[x] = {}
- dictionary = dictionary[x]
+ dictionary = dictionary.setdefault(x, {})
dictionary[p[0]] = translation
def gettext_json(fp, indent = False):