summaryrefslogtreecommitdiff
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-13 09:44:00 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-13 09:44:00 +0200
commitb3936044dbd7732a3da12e8901e57aa6bbb8006e (patch)
tree7c35bd4b5204799279c8f9567a63a92fe0009bc2 /Lib/ctypes
parent86f7fe2081eae28a74be681453a59c243f9632cf (diff)
parentc5134c83efd1055ea4a9f3680ff29d0d71cd11f7 (diff)
downloadcpython-b3936044dbd7732a3da12e8901e57aa6bbb8006e.tar.gz
Issue #29219: Fixed infinite recursion in the repr of uninitialized
ctypes.CDLL instances.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index 1c9d3a525b..f8709683fb 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -324,6 +324,10 @@ class CDLL(object):
"""
_func_flags_ = _FUNCFLAG_CDECL
_func_restype_ = c_int
+ # default values for repr
+ _name = '<uninitialized>'
+ _handle = 0
+ _FuncPtr = None
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
use_errno=False,