src/eric7/DebugClients/Python/DebugVariables.py

branch
eric7
changeset 10045
f5c57f8d17a4
parent 9653
e67609152c5e
child 10060
b946699e9e79
equal deleted inserted replaced
10044:fd95315b1c26 10045:f5c57f8d17a4
50 @return list containing the variable attributes 50 @return list containing the variable attributes
51 @rtype list 51 @rtype list
52 """ 52 """
53 d = [] 53 d = []
54 for name in dir(var): 54 for name in dir(var):
55 with contextlib.suppress(AttributeError): 55 try:
56 attribute = getattr(var, name) 56 attribute = getattr(var, name)
57 d.append((name, attribute)) 57 except Exception:
58 continue
59 d.append((name, attribute))
58 60
59 return d 61 return d
60 62
61 63
62 ############################################################ 64 ############################################################
79 containing the variable attributes 81 containing the variable attributes
80 @ytype tuple of (int, list) 82 @ytype tuple of (int, list)
81 """ 83 """
82 d = [] 84 d = []
83 for name in dir(var): 85 for name in dir(var):
84 with contextlib.suppress(AttributeError): 86 try:
85 attribute = getattr(var, name) 87 attribute = getattr(var, name)
86 d.append((name, attribute)) 88 except Exception:
89 continue
90 d.append((name, attribute))
87 91
88 yield -1, d 92 yield -1, d
89 while True: 93 while True:
90 yield -2, [] 94 yield -2, []
91 95

eric ide

mercurial