[pypy-commit] pypy py3.7: struct.format is now a str

cfbolz pypy.commits at gmail.com
Fri Jan 24 06:32:26 EST 2020


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: py3.7
Changeset: r98579:ccd91dffdc19
Date: 2020-01-23 16:15 +0100
http://bitbucket.org/pypy/pypy/changeset/ccd91dffdc19/

Log:	struct.format is now a str

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
@@ -215,7 +215,7 @@
 W_Struct.typedef = TypeDef("Struct",
     __new__=interp2app(W_Struct.descr__new__.im_func),
     __init__=interp2app(W_Struct.descr__init__),
-    format=interp_attrproperty("format", cls=W_Struct, wrapfn="newbytes"),
+    format=interp_attrproperty("format", cls=W_Struct, wrapfn="newtext"),
     size=interp_attrproperty("size", cls=W_Struct, wrapfn="newint"),
 
     pack=interp2app(W_Struct.descr_pack),
diff --git a/pypy/module/struct/test/test_struct.py b/pypy/module/struct/test/test_struct.py
--- a/pypy/module/struct/test/test_struct.py
+++ b/pypy/module/struct/test/test_struct.py
@@ -488,7 +488,7 @@
 
     def test_struct_object_attrib(self):
         s = self.struct.Struct('i')
-        assert s.format == b'i'
+        assert s.format == 'i'
 
     def test_trailing_counter(self):
         import array


More information about the pypy-commit mailing list