mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Merge #11675
This commit is contained in:
commit
657bd0a25d
3 changed files with 22 additions and 1 deletions
|
@ -80,7 +80,9 @@ def RawArray(typecode_or_type, size_or_initializer):
|
|||
type_ = typecode_to_type.get(typecode_or_type, typecode_or_type)
|
||||
if isinstance(size_or_initializer, int):
|
||||
type_ = type_ * size_or_initializer
|
||||
return _new_value(type_)
|
||||
obj = _new_value(type_)
|
||||
ctypes.memset(ctypes.addressof(obj), 0, ctypes.sizeof(obj))
|
||||
return obj
|
||||
else:
|
||||
type_ = type_ * len(size_or_initializer)
|
||||
result = _new_value(type_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue