diff -r a30cdf366c02 Lib/ctypes/__init__.py --- a/Lib/ctypes/__init__.py Tue Jan 10 11:30:44 2017 +0800 +++ b/Lib/ctypes/__init__.py Tue Jan 10 22:42:02 2017 +0200 @@ -324,6 +324,10 @@ class CDLL(object): """ _func_flags_ = _FUNCFLAG_CDECL _func_restype_ = c_int + # default values for repr + _name = '' + _handle = 0 + _FuncPtr = None def __init__(self, name, mode=DEFAULT_MODE, handle=None, use_errno=False,