[Python-checkins] python/dist/src/Lib doctest.py,1.30,1.31
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Mon Sep 1 20:09:07 EDT 2003
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv17836
Modified Files:
doctest.py
Log Message:
SF 798269: bug fix for doctest (sf bug id: 798254
(Contributed by Alexander Belopolsky.)
Doctest would crash when encountering unbound methods:
class A:
def f(self): pass
class C(A):
g = A.f
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** doctest.py 16 Jul 2003 19:25:22 -0000 1.30
--- doctest.py 2 Sep 2003 02:09:05 -0000 1.31
***************
*** 303,306 ****
--- 303,307 ----
from inspect import isclass as _isclass
from inspect import isfunction as _isfunction
+ from inspect import ismethod as _ismethod
from inspect import ismodule as _ismodule
from inspect import classify_class_attrs as _classify_class_attrs
***************
*** 931,939 ****
if type(v) in _StringTypes:
f, t = self.runstring(v, thisname)
! elif _isfunction(v) or _isclass(v):
f, t = self.rundoc(v, thisname)
else:
raise TypeError("Tester.run__test__: values in "
! "dict must be strings, functions "
"or classes; " + `v`)
failures = failures + f
--- 932,940 ----
if type(v) in _StringTypes:
f, t = self.runstring(v, thisname)
! elif _isfunction(v) or _isclass(v) or _ismethod(v):
f, t = self.rundoc(v, thisname)
else:
raise TypeError("Tester.run__test__: values in "
! "dict must be strings, functions, methods, "
"or classes; " + `v`)
failures = failures + f
More information about the Python-checkins
mailing list