[Python-checkins] python/dist/src/Lib inspect.py,1.26.10.3,1.26.10.4

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
2003年6月27日 11:16:23 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv28576
Modified Files:
 Tag: release22-maint
	inspect.py 
Log Message:
Fix for SF bug 620190: getargspec() doesn't understand methods.
Index: inspect.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/inspect.py,v
retrieving revision 1.26.10.3
retrieving revision 1.26.10.4
diff -C2 -d -r1.26.10.3 -r1.26.10.4
*** inspect.py	19 Jan 2003 14:16:19 -0000	1.26.10.3
--- inspect.py	27 Jun 2003 18:16:21 -0000	1.26.10.4
***************
*** 620,623 ****
--- 620,625 ----
 'varargs' and 'varkw' are the names of the * and ** arguments or None.
 'defaults' is an n-tuple of the default values of the last n arguments."""
+ if ismethod(func):
+ func = func.im_func
 if not isfunction(func): raise TypeError, 'arg is not a Python function'
 args, varargs, varkw = getargs(func.func_code)

AltStyle によって変換されたページ (->オリジナル) /