Author: Antonio Cuni <[email protected]>
Branch: faster-rstruct
Changeset: r80804:5c33c457e1ac
Date: 2015-11-20 15:41 +0100
http://bitbucket.org/pypy/pypy/changeset/5c33c457e1ac/

Log:    try hard to run the rstruct code when calling runpack before the
        translation

diff --git a/rpython/rlib/rstruct/runpack.py b/rpython/rlib/rstruct/runpack.py
--- a/rpython/rlib/rstruct/runpack.py
+++ b/rpython/rlib/rstruct/runpack.py
@@ -100,13 +100,6 @@
         exec source.compile() in miniglobals
         self.unpack = miniglobals['unpack'] # override not-rpython version
 
-    def unpack(self, s):
-        # NOT_RPYTHON
-        res = unpack(self.fmt, s)
-        if len(res) == 1:
-            return res[0]
-        return res
-
     def _freeze_(self):
         assert self.formats
         self._create_unpacking_func()
@@ -115,6 +108,7 @@
 def create_unpacker(unpack_str):
     fmtiter = FrozenUnpackIterator(unpack_str)
     fmtiter.interpret(unpack_str)
+    assert fmtiter._freeze_()
     return fmtiter
 create_unpacker._annspecialcase_ = 'specialize:memo'
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to