Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6196ac4

Browse files
Issue #29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.
2 parents cc28337 + 4c4ff5f commit 6196ac4

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/ctypes/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ class CDLL(object):
324324
"""
325325
_func_flags_ = _FUNCFLAG_CDECL
326326
_func_restype_ = c_int
327+
# default values for repr
328+
_name = '<uninitialized>'
329+
_handle = 0
330+
_FuncPtr = None
327331

328332
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
329333
use_errno=False,

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ Core and Builtins
212212
Library
213213
-------
214214

215+
- Issue #29219: Fixed infinite recursion in the repr of uninitialized
216+
ctypes.CDLL instances.
217+
215218
- Issue #29192: Removed deprecated features in the http.cookies module.
216219

217220
- Issue #29193: A format string argument for string.Formatter.format()

0 commit comments

Comments
 (0)