Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r71306:d93da947bbf6 Date: 2014-05-05 18:35 -0400 http://bitbucket.org/pypy/pypy/changeset/d93da947bbf6/
Log: promote format on struct.Struct objects diff --git a/pypy/module/pypyjit/test_pypy_c/test_struct.py b/pypy/module/pypyjit/test_pypy_c/test_struct.py --- a/pypy/module/pypyjit/test_pypy_c/test_struct.py +++ b/pypy/module/pypyjit/test_pypy_c/test_struct.py @@ -44,7 +44,6 @@ """) def test_struct_object(self): - skip("XXX broken") def main(n): import struct s = struct.Struct("i") diff --git a/pypy/module/struct/interp_struct.py b/pypy/module/struct/interp_struct.py --- a/pypy/module/struct/interp_struct.py +++ b/pypy/module/struct/interp_struct.py @@ -115,18 +115,18 @@ return self def descr_pack(self, space, args_w): - return pack(space, self.format, args_w) + return pack(space, jit.promote_string(self.format), args_w) @unwrap_spec(offset=int) def descr_pack_into(self, space, w_buffer, offset, args_w): - return pack_into(space, self.format, w_buffer, offset, args_w) + return pack_into(space, jit.promote_string(self.format), w_buffer, offset, args_w) def descr_unpack(self, space, w_str): - return unpack(space, self.format, w_str) + return unpack(space, jit.promote_string(self.format), w_str) @unwrap_spec(offset=int) def descr_unpack_from(self, space, w_buffer, offset=0): - return unpack_from(space, self.format, w_buffer, offset) + return unpack_from(space, jit.promote_string(self.format), w_buffer, offset) W_Struct.typedef = TypeDef("Struct", __new__=interp2app(W_Struct.descr__new__.im_func), _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit