Commit 3f06b14a authored by agronholm's avatar agronholm

Changed file() calls to open() calls

--HG--
branch : distribute
extra : rebase_source : a2567f3f28d896dd0abbbed8a2626cc4ecb3e44e
parent ceb63ce0
...@@ -1676,7 +1676,7 @@ def find_on_path(importer, path_item, only=False): ...@@ -1676,7 +1676,7 @@ def find_on_path(importer, path_item, only=False):
for dist in find_distributions(os.path.join(path_item, entry)): for dist in find_distributions(os.path.join(path_item, entry)):
yield dist yield dist
elif not only and lower.endswith('.egg-link'): elif not only and lower.endswith('.egg-link'):
for line in file(os.path.join(path_item, entry)): for line in open(os.path.join(path_item, entry)):
if not line.strip(): continue if not line.strip(): continue
for item in find_distributions(os.path.join(path_item,line.rstrip())): for item in find_distributions(os.path.join(path_item,line.rstrip())):
yield item yield item
......
...@@ -105,7 +105,7 @@ class develop(easy_install): ...@@ -105,7 +105,7 @@ class develop(easy_install):
def uninstall_link(self): def uninstall_link(self):
if os.path.exists(self.egg_link): if os.path.exists(self.egg_link):
log.info("Removing %s (link to %s)", self.egg_link, self.egg_base) log.info("Removing %s (link to %s)", self.egg_link, self.egg_base)
contents = [line.rstrip() for line in file(self.egg_link)] contents = [line.rstrip() for line in open(self.egg_link)]
if contents not in ([self.egg_path], [self.egg_path, self.setup_path]): if contents not in ([self.egg_path], [self.egg_path, self.setup_path]):
log.warn("Link points to %s: uninstall aborted", contents) log.warn("Link points to %s: uninstall aborted", contents)
return return
......
...@@ -241,7 +241,7 @@ class PackageIndex(Environment): ...@@ -241,7 +241,7 @@ class PackageIndex(Environment):
self.scan_egg_link(item, entry) self.scan_egg_link(item, entry)
def scan_egg_link(self, path, entry): def scan_egg_link(self, path, entry):
lines = filter(None, map(str.strip, file(os.path.join(path, entry)))) lines = filter(None, map(str.strip, open(os.path.join(path, entry))))
if len(lines)==2: if len(lines)==2:
for dist in find_distributions(os.path.join(path, lines[0])): for dist in find_distributions(os.path.join(path, lines[0])):
dist.location = os.path.join(path, *lines) dist.location = os.path.join(path, *lines)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment