[pywin32-bugs] [ pywin32-Patches-886824 ] [Bug: 817035] Exception while browsing python path
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2004-07-13 05:32:32
|
Patches item #886824, was opened at 2004-01-29 20:34 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=886824&group_id=78018 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Maxim Sokolov (dzuki) Assigned to: Nobody/Anonymous (nobody) Summary: [Bug: 817035] Exception while browsing python path Initial Comment: Sorry for the previous patch, it wont work. When user browses python path Tools->Browse PythonPath the program throws exception in tools. BrowseProjects.HLICLBRItem.GetText when trying to display module-level functions. Proposed patch of browseProjects file at HLICLBRClass. __init__: Compare: (<)C: \Programs\Python23\Lib\site-packages\Pythonwin\pywin \tools\browseProjects.py (8130 bytes) with: (>)C:\Programs\Python-2.3. 3\Lib\site-packages\Pythonwin\pywin\tools\browseProjec ts.py (8239 bytes) 41,50c41,50 < try: < name = clbrclass.name < file = clbrclass.file < lineno = clbrclass.lineno < self.super = clbrclass.super < self.methods = clbrclass.methods < except AttributeError: < name = clbrclass < file = lineno = None < self.super = []; self.methods = {} --- > def get_attr(obj, attr, default_value): > if hasattr(obj, attr): > return obj.__dict__[attr] > else: > return default_value > name = get_attr(clbrclass, "name", clbrclass) > file = get_attr(clbrclass, "file", None) > lineno = get_attr(clbrclass, "lineno", None) > self.super = get_attr(clbrclass, "super", []) > self.methods = get_attr(clbrclass, "methods", {}) ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2004-07-13 15:32 Message: Logged In: YES user_id=14198 My fix was a little different - I changed the start of that class to look like: class HLICLBRItem(hierlist.HierListItem): def __init__(self, name, file, lineno, suffix = ""): # If the 'name' object itself has a .name, use it. Not sure # how this happens, but seems pyclbr related. # See PyWin32 bug 817035 self.name = getattr(name, "name", name) It seems to fix the problem for me - can you confirm it does for you too? Thanks ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=886824&group_id=78018 |