mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Patch #1303: Adapt str8 constructor to bytes (now buffer) one.
This commit is contained in:
parent
97f9d4f312
commit
bd1c68c94f
15 changed files with 212 additions and 72 deletions
|
@ -36,7 +36,7 @@ from _struct import Struct as _Struct, error
|
|||
class Struct(_Struct):
|
||||
def __init__(self, fmt):
|
||||
if isinstance(fmt, str):
|
||||
fmt = str8(fmt)
|
||||
fmt = str8(fmt, 'latin1')
|
||||
_Struct.__init__(self, fmt)
|
||||
|
||||
_MAXCACHE = 100
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue