Remove print() usage. (trunk r15494)
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 21:09:26 +0000 (21:09 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 21:09:26 +0000 (21:09 -0000)
svn path=/main/branches/2.1.7/; revision=15695

pym/portage/dbapi/porttree.py

index 39dd6eb8ced0d2f4e26bf757f1bb52a4a9e3269a..124783ca25e7af7691d2f07176c4b8b20da6549c 100644 (file)
@@ -2,8 +2,6 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-from __future__ import print_function
-
 __all__ = [
        "close_portdbapi_caches", "FetchlistDict", "portagetree", "portdbapi"
 ]
@@ -809,8 +807,8 @@ class portdbapi(dbapi):
                checksums = mf.getDigests()
                if not checksums:
                        if debug: 
-                               print("[empty/missing/bad digest]: "+mypkg)
-                       return None
+                               writemsg("[empty/missing/bad digest]: %s\n" % (mypkg,))
+                       return {}
                filesdict={}
                myfiles = self.getFetchMap(mypkg, useflags=useflags)
                #XXX: maybe this should be improved: take partial downloads
@@ -1091,8 +1089,8 @@ class portdbapi(dbapi):
                        else:
                                myval = list(self._iter_match(mydep, self.cp_list(mykey)))
                else:
-                       print("ERROR: xmatch doesn't handle", level, "query!")
-                       raise KeyError
+                       raise AssertionError(
+                               "Invalid level argument: '%s'" % level)
 
                if self.frozen and (level not in ["match-list", "bestmatch-list"]):
                        self.xcache[level][mydep] = myval