Message259300
this is my first contribution to Python core so I really have no idea how to do this, but I have found a solution (works in Py3.4, 2.7):
in doctest.py after line 1087 ("lineno = getattr(obj, 'co_firstlineno', None)-1") add these lines:
if lineno is None and isinstance(obj, property) and \
obj.fget is not None:
obj = obj.fget.__code__
lineno = getattr(obj, 'co_firstlineno', None)
# no need for -1 because of decorator.
I can try to make a patch file for this, but just want to be sure I'm on the right track for contributing first. I know how to do a Git pull, but not hg/patch.
(p.s., I think the current code "lineno = getattr(obj, 'co_firstlineno', None)-1" has an error; if the getattr does not find 'co_firstlineno', it will return None and then subtract 1 from None which is a TypeError). |
|
Date |
User |
Action |
Args |
2016-01-31 18:51:59 | mscuthbert | set | recipients:
+ mscuthbert, r.david.murray, BreamoreBoy, Ronny.Pfannschmidt |
2016-01-31 18:51:59 | mscuthbert | set | messageid: <1454266319.39.0.503739011862.issue17446@psf.upfronthosting.co.za> |
2016-01-31 18:51:59 | mscuthbert | link | issue17446 messages |
2016-01-31 18:51:59 | mscuthbert | create | |
|