[pypy-commit] pypy py3k: oops, broke translation

arigo pypy.commits at gmail.com
Sat Aug 20 12:36:20 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: py3k
Changeset: r86355:1982fef3bbf8
Date: 2016-08-20 18:35 +0200
http://bitbucket.org/pypy/pypy/changeset/1982fef3bbf8/

Log:	oops, broke translation

diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py
--- a/pypy/interpreter/mixedmodule.py
+++ b/pypy/interpreter/mixedmodule.py
@@ -131,25 +131,29 @@
 
     def getdict(self, space):
         if self.lazy:
-            # Force the dictionary by calling all lazy loaders now.
-            # This also saves in self.w_initialdict a copy of all the
-            # initial values, including if they have already been
-            # modified by setdictvalue().
-            for name in self.loaders:
-                w_value = self.get(name)
-                space.setitem(self.w_dict, space.new_interned_str(name), w_value)
-            self.lazy = False
-            self.save_module_content_for_future_reload()
-            for key, w_initial_value in self.lazy_initial_values_w.items():
-                w_key = space.new_interned_str(key)
-                if w_initial_value is not None:
-                    space.setitem(self.w_initialdict, w_key, w_initial_value)
-                else:
-                    if space.finditem(self.w_initialdict, w_key) is not None:
-                        space.delitem(self.w_initialdict, w_key)
-            del self.lazy_initial_values_w
+            self._force_lazy_dict_now()
         return self.w_dict
 
+    def _force_lazy_dict_now(self):
+        # Force the dictionary by calling all lazy loaders now.
+        # This also saves in self.w_initialdict a copy of all the
+        # initial values, including if they have already been
+        # modified by setdictvalue().
+        space = self.space
+        for name in self.loaders:
+            w_value = self.get(name)
+            space.setitem(self.w_dict, space.new_interned_str(name), w_value)
+        self.lazy = False
+        self.save_module_content_for_future_reload()
+        for key, w_initial_value in self.lazy_initial_values_w.items():
+            w_key = space.new_interned_str(key)
+            if w_initial_value is not None:
+                space.setitem(self.w_initialdict, w_key, w_initial_value)
+            else:
+                if space.finditem(self.w_initialdict, w_key) is not None:
+                    space.delitem(self.w_initialdict, w_key)
+        del self.lazy_initial_values_w
+
     def _cleanup_(self):
         self.getdict(self.space)
         self.w_initialdict = None


More information about the pypy-commit mailing list