Changeset 2601:e34979579f3e in livinglogic.python.xist

Show
Ignore:
Timestamp:
10/31/06 18:00:31 (13 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

inspect seems to have problems determining the module of a decorated method
=> undecorate it.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/xist/ns/doc.py

    r2524 r2601  
    12161216 
    12171217    if inspect.ismethod(thing): 
     1218        # Use the original method instead of the decorator 
     1219        realthing = thing 
     1220        while hasattr(realthing, "__wrapped__"): 
     1221            realthing = realthing.__wrapped__ 
    12181222        for ref in node//pyref: 
    12191223            if u"module" not in ref.attrs: 
    1220                 ref[u"module"] = cls._getmodulename(thing) 
     1224                ref[u"module"] = cls._getmodulename(realthing) 
    12211225                if u"class_" not in ref.attrs: 
    12221226                    ref[u"class_"] = thing.im_class.__name__ 
     
    12241228                        ref[u"method"] = thing.__name__ 
    12251229    elif inspect.isfunction(thing): 
     1230        # Use the original method instead of the decorator 
     1231        while hasattr(thing, "__wrapped__"): 
     1232            thing = thing.__wrapped__ 
    12261233        for ref in node//pyref: 
    12271234            if u"module" not in ref.attrs: