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.
This commit is contained in:
Éric Araujo 2011-09-15 18:18:51 +02:00
parent 86ca04ccc7
commit 37ccd6f794
2 changed files with 27 additions and 23 deletions

View file

@ -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