summaryrefslogtreecommitdiff
path: root/Lib/packaging/database.py
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-09-15 18:18:51 +0200
committerÉric Araujo <merwok@netwok.org>2011-09-15 18:18:51 +0200
commit37ccd6f794539e0678b7a7ad938e571cc73e106c (patch)
tree0cd580cc92f8921801406a44eb94ff52eb85d852 /Lib/packaging/database.py
parent86ca04ccc72820b3233f0010ad4c6f91208a7e18 (diff)
downloadcpython-git-37ccd6f794539e0678b7a7ad938e571cc73e106c.tar.gz
Fix packaging.database.Distribution.list_distinfo_files (#12785).
This method was supposed to return only the file under the dist-info directory, but it actually returned all installed files. The tests didn’t catch this because they were flawed; I updated them. Thanks to Nadeem Vawda and Jeremy Kloth for testing. As a bonus, the removal of os.path.relpath use should also fix the Windows buildbots.
Diffstat (limited to 'Lib/packaging/database.py')
-rw-r--r--Lib/packaging/database.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/packaging/database.py b/Lib/packaging/database.py
index c733b7af67..b606db6b05 100644
--- a/Lib/packaging/database.py
+++ b/Lib/packaging/database.py
@@ -263,7 +263,9 @@ class Distribution:
:returns: iterator of paths
"""
for path, checksum, size in self._get_records(local):
- yield path
+ # XXX add separator or use real relpath algo
+ if path.startswith(self.path):
+ yield path
def __eq__(self, other):
return isinstance(other, Distribution) and self.path == other.path