Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r74768:1b7b870d25f5
Date: 2014-11-30 14:12 -0800
http://bitbucket.org/pypy/pypy/changeset/1b7b870d25f5/

Log:    redo atom_strlist which we still need w/ a smaller diff from default

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
@@ -311,6 +311,12 @@
     return None
 
 
+def _put_str_list(space, m, strlist):
+    m.atom_int(TYPE_TUPLE, len(strlist))
+    atom_str = m.atom_str
+    for item in strlist:
+        atom_str(TYPE_STRING, item)
+
 @marshaller(PyCode)
 def marshal_pycode(space, w_pycode, m):
     m.start(TYPE_CODE)
@@ -324,9 +330,9 @@
     m.atom_str(TYPE_STRING, x.co_code)
     m.put_tuple_w(TYPE_TUPLE, x.co_consts_w)
     m.put_tuple_w(TYPE_TUPLE, x.co_names_w)
-    m.atom_strlist(TYPE_TUPLE, TYPE_STRING, x.co_varnames)
-    m.atom_strlist(TYPE_TUPLE, TYPE_STRING, x.co_freevars)
-    m.atom_strlist(TYPE_TUPLE, TYPE_STRING, x.co_cellvars)
+    _put_str_list(space, m, x.co_varnames)
+    _put_str_list(space, m, x.co_freevars)
+    _put_str_list(space, m, x.co_cellvars)
     m.atom_str(TYPE_STRING, x.co_filename)
     m.atom_str(TYPE_STRING, x.co_name)
     m.put_int(x.co_firstlineno)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to