Author: Amaury Forgeot d'Arc <amaur...@gmail.com>
Branch: 
Changeset: r47093:66a579857a84
Date: 2011-08-31 01:25 +0200
http://bitbucket.org/pypy/pypy/changeset/66a579857a84/

Log:    Small cleanup in marshall functions

diff --git a/pypy/module/marshal/interp_marshal.py 
b/pypy/module/marshal/interp_marshal.py
--- a/pypy/module/marshal/interp_marshal.py
+++ b/pypy/module/marshal/interp_marshal.py
@@ -40,7 +40,7 @@
         reader = FileReader(space, w_f)
     try:
         u = Unmarshaller(space, reader)
-        return u.load_w_obj(False)
+        return u.load_w_obj()
     finally:
         reader.finished()
 
@@ -49,7 +49,7 @@
 ignored."""
     space.timer.start("marshal loads")
     u = StringUnmarshaller(space, w_str)
-    obj = u.load_w_obj(False)
+    obj = u.load_w_obj()
     space.timer.stop("marshal loads")
     return obj
 
@@ -424,7 +424,7 @@
         lng = self.get_lng()
         return self.get(lng)
 
-    def get_w_obj(self, allow_null):
+    def get_w_obj(self, allow_null=False):
         space = self.space
         w_ret = space.w_None # something not None
         tc = self.get1()
@@ -434,9 +434,9 @@
                 'NULL object in marshal data'))
         return w_ret
 
-    def load_w_obj(self, allow_null):
+    def load_w_obj(self):
         try:
-            return self.get_w_obj(allow_null)
+            return self.get_w_obj()
         except rstackovf.StackOverflow:
             rstackovf.check_stack_overflow()
             self._overflow()
diff --git a/pypy/objspace/std/marshal_impl.py 
b/pypy/objspace/std/marshal_impl.py
--- a/pypy/objspace/std/marshal_impl.py
+++ b/pypy/objspace/std/marshal_impl.py
@@ -325,10 +325,10 @@
     # of building a list of tuples.
     w_dic = space.newdict()
     while 1:
-        w_key = u.get_w_obj(True)
+        w_key = u.get_w_obj(allow_null=True)
         if w_key is None:
             break
-        w_value = u.get_w_obj(False)
+        w_value = u.get_w_obj()
         space.setitem(w_dic, w_key, w_value)
     return w_dic
 register(TYPE_DICT, unmarshal_DictMulti)
@@ -364,7 +364,7 @@
 # so we no longer can handle it in interp_marshal.atom_strlist
 
 def unmarshal_str(u):
-    w_obj = u.get_w_obj(False)
+    w_obj = u.get_w_obj()
     try:
         return u.space.str_w(w_obj)
     except OperationError, e:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to