summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/_ipc/QueryCommand.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/package/ebuild/_ipc/QueryCommand.py b/pym/portage/package/ebuild/_ipc/QueryCommand.py
index 7bbb0e83b..d200fe80d 100644
--- a/pym/portage/package/ebuild/_ipc/QueryCommand.py
+++ b/pym/portage/package/ebuild/_ipc/QueryCommand.py
@@ -20,6 +20,12 @@ class QueryCommand(IpcCommand):
_db = None
+ @classmethod
+ def get_db(cls):
+ if cls._db is not None:
+ return cls._db
+ return portage.db
+
def __init__(self, settings, phase):
IpcCommand.__init__(self)
self.settings = settings
@@ -52,9 +58,7 @@ class QueryCommand(IpcCommand):
use = frozenset(use.split())
atom = atom.evaluate_conditionals(use)
- db = self._db
- if db is None:
- db = portage.db
+ db = self.get_db()
warnings_str = ''
if warnings: