From 6d6868206d5109fbbda9b716b597adb3440666bb Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 13 Oct 2012 19:44:18 -0700 Subject: [PATCH] Simplify Display.get_ver_str(). --- pym/_emerge/resolver/output.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index 6ae022e00..8a1e63ae5 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -676,12 +676,10 @@ class Display(object): @param pkg: _emerge.Package.Package instance @rtype string """ - ver_str = list(catpkgsplit(pkg.cpv)[2:]) - if ver_str[1] == "r0": - ver_str[1] = "" - else: - ver_str[1] = "-" + ver_str[1] - return ver_str[0]+ver_str[1] + ver_str = pkg.cpv.version + if ver_str.endswith("-r0"): + ver_str = ver_str[:-3] + return ver_str def _get_installed_best(self, pkg, pkg_info): -- 2.26.2