Michael Cuthbert added the comment:

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).

----------
nosy: +Michael Cuthbert

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17446>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to