From: W. Trevor King Date: Mon, 12 Nov 2012 02:54:17 +0000 (-0500) Subject: cpv: define package_list in compare_strs doctest X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6c751ebd67a981557e5bc9657efef2e6f5f4614d;p=gentoolkit.git 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. --- 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)