diff options
author | Éric Araujo <merwok@netwok.org> | 2011-07-29 00:37:21 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-07-29 00:37:21 (GMT) |
commit | bab50cb1247f79d10a746ec4dae88848319ff162 (patch) | |
tree | 0b7063f0121143132893d16c52141e54ce8eda1d /Lib/packaging/depgraph.py | |
parent | 7b0908a8e444d735d459bac7c32566f6f11882fe (diff) | |
download | cpython-bab50cb1247f79d10a746ec4dae88848319ff162.zip cpython-bab50cb1247f79d10a746ec4dae88848319ff162.tar.gz cpython-bab50cb1247f79d10a746ec4dae88848319ff162.tar.bz2 |
Minor packaging cleanup.
- Use shortcut dist.version instead of going through metadata;
- Use %r throughout to display project names and paths.
Diffstat (limited to 'Lib/packaging/depgraph.py')
-rw-r--r-- | Lib/packaging/depgraph.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/packaging/depgraph.py b/Lib/packaging/depgraph.py index b3c555a..843aab4 100644 --- a/Lib/packaging/depgraph.py +++ b/Lib/packaging/depgraph.py @@ -72,7 +72,7 @@ class DependencyGraph: self.missing[distribution].append(requirement) def _repr_dist(self, dist): - return '%r %s' % (dist.name, dist.metadata['Version']) + return '%r %s' % (dist.name, dist.version) def repr_node(self, dist, level=1): """Prints only a subgraph""" @@ -145,7 +145,7 @@ def generate_graph(dists): graph.add_distribution(dist) provides = (dist.metadata['Provides-Dist'] + dist.metadata['Provides'] + - ['%s (%s)' % (dist.name, dist.metadata['Version'])]) + ['%s (%s)' % (dist.name, dist.version)]) for p in provides: comps = p.strip().rsplit(" ", 1) |