diff options
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 |
commit | 37ccd6f794539e0678b7a7ad938e571cc73e106c (patch) | |
tree | 0cd580cc92f8921801406a44eb94ff52eb85d852 /Lib/packaging/database.py | |
parent | 86ca04ccc72820b3233f0010ad4c6f91208a7e18 (diff) | |
download | cpython-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.py | 4 |
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 |