DebugClients/Python3/DebugUtilities.py

branch
6_1_x
changeset 4541
e8ddd9d76414
parent 4455
ca13a6f6c452
child 4631
5c1a96925da4
equal deleted inserted replaced
4539:beac8323fa9e 4541:e8ddd9d76414
42 'varargs' and 'varkw' are the names of the * and ** arguments or None 42 'varargs' and 'varkw' are the names of the * and ** arguments or None
43 and 'locals' is the locals dictionary of the given frame. 43 and 'locals' is the locals dictionary of the given frame.
44 @exception TypeError raised if the input parameter is not a frame object 44 @exception TypeError raised if the input parameter is not a frame object
45 """ 45 """
46 if not isframe(frame): 46 if not isframe(frame):
47 raise TypeError('{!r} is not a frame object'.format(frame)) 47 raise TypeError('{0!r} is not a frame object'.format(frame))
48 48
49 args, varargs, kwonlyargs, varkw = _getfullargs(frame.f_code) 49 args, varargs, kwonlyargs, varkw = _getfullargs(frame.f_code)
50 return ArgInfo(args + kwonlyargs, varargs, varkw, frame.f_locals) 50 return ArgInfo(args + kwonlyargs, varargs, varkw, frame.f_locals)
51 51
52 52
61 argument names, and 'varargs' and 'varkw' are the names of the 61 argument names, and 'varargs' and 'varkw' are the names of the
62 * and ** arguments or None. 62 * and ** arguments or None.
63 @exception TypeError raised if the input parameter is not a code object 63 @exception TypeError raised if the input parameter is not a code object
64 """ 64 """
65 if not iscode(co): 65 if not iscode(co):
66 raise TypeError('{!r} is not a code object'.format(co)) 66 raise TypeError('{0!r} is not a code object'.format(co))
67 67
68 nargs = co.co_argcount 68 nargs = co.co_argcount
69 names = co.co_varnames 69 names = co.co_varnames
70 nkwargs = co.co_kwonlyargcount 70 nkwargs = co.co_kwonlyargcount
71 args = list(names[:nargs]) 71 args = list(names[:nargs])
120 specs.append(formatvarkw(varkw) + formatvalue(locals[varkw])) 120 specs.append(formatvarkw(varkw) + formatvalue(locals[varkw]))
121 argvalues = '(' + ', '.join(specs) + ')' 121 argvalues = '(' + ', '.join(specs) + ')'
122 if '__return__' in locals: 122 if '__return__' in locals:
123 argvalues += " -> " + formatvalue(locals['__return__']) 123 argvalues += " -> " + formatvalue(locals['__return__'])
124 return argvalues 124 return argvalues
125
126 #
127 # eflag: noqa = M702

eric ide

mercurial