From 6c751ebd67a981557e5bc9657efef2e6f5f4614d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 11 Nov 2012 21:54:17 -0500 Subject: [PATCH] cpv: define package_list in compare_strs doctest This is not much of a doctest, since we aren't using compare_strs() anywhere, but at least it doesn't error out. Note that comparisons have been reworked in Python 3 where cmp() has been removed. --- pym/gentoolkit/cpv.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pym/gentoolkit/cpv.py b/pym/gentoolkit/cpv.py index cda68d7..9c72431 100644 --- a/pym/gentoolkit/cpv.py +++ b/pym/gentoolkit/cpv.py @@ -178,6 +178,7 @@ def compare_strs(pkg1, pkg2): as: package_list.sort(cpv.compare_strs) An alternative is to use the CPV descriptor from gentoolkit.cpv: + >>> package_list = ['sys-apps/portage-9999', 'media-video/ffmpeg-9999'] >>> cpvs = sorted(CPV(x) for x in package_list) @see: >>> help(cmp) -- 2.26.2