[ python-Bugs-1697215 ] execute

SourceForge.net noreply at sourceforge.net
Mon Apr 9 23:23:56 CEST 2007


"execute sitedir if it starts with 'import'" doesn'
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-SourceForge-Tracker-unixname: python
X-SourceForge-Tracker-trackerid: 105470
X-SourceForge-Tracker-itemid: 1697215
X-SourceForge-Tracker-itemstatus: Open
X-SourceForge-Tracker-itemassignee: nobody
X-SourceForge-Tracker-itemupdate-reason: Tracker Item Submitted
X-SourceForge-Tracker-itemupdate-username: Item Submitter

Bugs item #1697215, was opened at 2007-04-09 16:23
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1697215&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: cfk (carlfk)
Assigned to: Nobody/Anonymous (nobody)
Summary: execute
"execute sitedir if it starts with 'import'" doesn'

Initial Comment:
docstring says "execute sitedir" - but that isn't what gets executed. 

suggested: 
    """Add a new path to known_paths by combining sitedir and 'name' 
or execute lines in name.pth that start with 'import'"""

site.py

def addpackage(sitedir, name, known_paths):

    """Add a new path to known_paths by combining sitedir and 'name' or execute sitedir if it starts with 'import'"""

    fullname = os.path.join(sitedir, name)
        f = open(fullname, "rU")
        for line in f:
            if line.startswith("import"):
                exec line
                                      

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1697215&group_id=5470


More information about the Python-bugs-list mailing list