Mercurial > cpython-lru_cache-weakref
diff Lib/packaging/database.py @ 72384:c6d52971dd2a
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.
| author | Éric Araujo <merwok@netwok.org> |
|---|---|
| date | Thu, 15 Sep 2011 18:18:51 +0200 |
| parents | 0b941202abb5 |
| children | a400c1c087dd |
line wrap: on
line diff
--- a/Lib/packaging/database.py Wed Sep 14 14:56:32 2011 -0700 +++ b/Lib/packaging/database.py Thu Sep 15 18:18:51 2011 +0200 @@ -263,7 +263,9 @@ :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
