Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def addpackage(sitedir, name, known_paths):
- """Process a .pth file within the site-packages directory:
- For each line in the file, either combine it with sitedir to a path
- and add that to known_paths, or execute it if it starts with 'import '.
- """
- if known_paths is None:
- known_paths = _init_pathinfo()
- reset = True
- else:
- reset = False
- fullname = os.path.join(sitedir, name)
- print(fullname)
- try:
- f = open(fullname, "r")
- except OSError:
- return
- with f:
- for n, line in enumerate(f):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement