aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-08-30 13:56:54 -0400
committerJason R. Coombs <jaraco@jaraco.com>2015-08-30 13:56:54 -0400
commit8496cfb24aa20109e64a3b03c972792cd911c086 (patch)
tree15d22eee8b350d740b26ddbe04bd9285e79bed29
parentc05680c5d1b4f0a688a4e560fabde6aa3022596d (diff)
downloadexternal_python_setuptools-8496cfb24aa20109e64a3b03c972792cd911c086.tar.gz
external_python_setuptools-8496cfb24aa20109e64a3b03c972792cd911c086.tar.bz2
external_python_setuptools-8496cfb24aa20109e64a3b03c972792cd911c086.zip
Use relpath to produce results relative to 'dir'
-rw-r--r--setuptools/__init__.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index a884d2d3..0d1994dc 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -143,18 +143,13 @@ def findall(dir=os.curdir):
"""Find all files under 'dir' and return the list of full filenames
(relative to 'dir').
"""
- def _strip_leading_curdir(base):
- do_strip = base == os.curdir or base.startswith(os.curdir + os.sep)
- return base[2:] if do_strip else base
-
- def _base_prepend(base):
- base = _strip_leading_curdir(base)
- return functools.partial(os.path.join, base)
+ def _prepend(base):
+ return functools.partial(os.path.join, os.path.relpath(base, dir))
return [
file
for base, dirs, files in os.walk(dir, followlinks=True)
- for file in map(_base_prepend(base), files)
+ for file in map(_prepend(base), files)
if os.path.isfile(file)
]