summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-12-08 19:06:41 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-12-08 19:06:41 -0500
commit7099e8141d9ce800db92cabfc788894ab16a3365 (patch)
tree76c0f919e8c57b3bee4df8f70ee2362fcc871f2c
parent17e9735f553782939e7f7890f12775b659648420 (diff)
downloadpython-setuptools-bitbucket-7099e8141d9ce800db92cabfc788894ab16a3365.tar.gz
Extract variable
-rwxr-xr-xsetuptools/package_index.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 330b8391..1c156f07 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -1031,11 +1031,12 @@ def local_open(url):
elif path.endswith('/') and os.path.isdir(filename):
files = []
for f in os.listdir(filename):
+ filepath = os.path.join(filename, f)
if f == 'index.html':
- with open(os.path.join(filename, f), 'r') as fp:
+ with open(filepath, 'r') as fp:
body = fp.read()
break
- elif os.path.isdir(os.path.join(filename, f)):
+ elif os.path.isdir(filepath):
f += '/'
files.append('<a href="{name}">{name}</a>'.format(name=f))
else: