diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-07-08 13:39:56 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-07-08 13:39:56 -0500 |
commit | 910789f10fb314fe7149be84aa57d6ec12ad4a7b (patch) | |
tree | a658027493df6d758e5d0b802ffa72e66594ad1e /Lib/packaging/database.py | |
parent | ae10c0653e5469e7f41f12cee35bfe653a389cbc (diff) | |
parent | 4a183b47f353a25b76aaaf1b7043458dbcab8890 (diff) | |
download | cpython-git-910789f10fb314fe7149be84aa57d6ec12ad4a7b.tar.gz |
merge heads
Diffstat (limited to 'Lib/packaging/database.py')
-rw-r--r-- | Lib/packaging/database.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Lib/packaging/database.py b/Lib/packaging/database.py index 67946a249b..c71d608491 100644 --- a/Lib/packaging/database.py +++ b/Lib/packaging/database.py @@ -158,17 +158,18 @@ class Distribution: self.name, self.version, self.path) def _get_records(self, local=False): + results = [] with self.get_distinfo_file('RECORD') as record: record_reader = csv.reader(record, delimiter=',', lineterminator='\n') - # XXX needs an explaining comment for row in record_reader: - path, checksum, size = (row[:] + - [None for i in range(len(row), 3)]) + missing = [None for i in range(len(row), 3)] + path, checksum, size = row + missing if local: path = path.replace('/', os.sep) path = os.path.join(sys.prefix, path) - yield path, checksum, size + results.append((path, checksum, size)) + return results def get_resource_path(self, relative_path): with self.get_distinfo_file('RESOURCES') as resources_file: @@ -197,7 +198,8 @@ class Distribution: :type local: boolean :returns: iterator of (path, md5, size) """ - return self._get_records(local) + for result in self._get_records(local): + yield result def uses(self, path): """ |