Bugs item #794193, was opened at 2003-08-24 11:56
Message generated for change (Comment added) made by cprinos
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=794193&group_id=78018
Category: pythonwin
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Malte Forkel (mforkel)
Assigned to: Nobody/Anonymous (nobody)
Summary: Pythonwin module browser has problem with top level function
Initial Comment:
After upgrading from Python 2.2 to Python 2.3, I noticed
that in the module browser all top level functions are
simply shown as instances of pyclbr.Function. These list
entries can't be used to locate the function definition in
the source code. I tried win32all builds 155 and 157 with
Python 2.3.0.0 on a Windows 2000 machine.
I managed to fix the problem by adding the following
__init__ function to HierListCLBRFunction in
ModuleBrowser.py:
def __init__(self, clbrclass, suffix = ""):
try:
name = clbrclass.name
file = clbrclass.file
lineno = clbrclass.lineno
except AttributeError:
name = clbrclass
file = lineno = None
self.super = []
self.methods = {}
HierListCLBRItem.__init__(self, name, file, lineno,
suffix)
This code is a variation on the HierListCLBRClass.__init__
function.
I guess the problem is caused by instances of
pyclbr.Function not having the attributes 'super'
and 'name' that are accessed in
HierListCLBRClass.__init__. The AttributeError error
handling code will then set locals 'name', 'file',
and 'lineno' to None.
I attach an edited version of ModuleBrowser.py, based
on win32all build 155.
----------------------------------------------------------------------
Comment By: Christopher J. Prinos (cprinos)
Date: 2003-10-06 12:42
Message:
Logged In: YES
user_id=571862
this patch works, although it might be better (6 of one, half
dozen of another)to have HierListCLBRFunction inherit from
HierListCLBRItem instead of HierLiestCLBRClass (then you
don't need to assign 'super' and 'method' attributes at all in
the __init__)
BTW, this was broken by a change from Python 2.2->2.3
when some of the pyclbr.py code was rewritten (and Function
info no longer inherit from Classe info)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=794193&group_id=78018
|