summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dep.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 38a84dc72..929e31dbe 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -710,9 +710,13 @@ def get_operator(mydep):
@return: The operator. One of:
'~', '=', '>', '<', '=*', '>=', or '<='
"""
- operator = getattr(mydep, "operator", False)
- if operator is not False:
- return operator
+ try:
+ return Atom(mydep).operator
+ except InvalidAtom:
+ pass
+
+ # Fall back to legacy code for backward compatibility.
+ operator = None
if mydep:
mydep = remove_slot(mydep)
if not mydep:
@@ -988,9 +992,6 @@ def dep_getkey(mydep):
@rtype: String
@return: The package category/package-version
"""
- cp = getattr(mydep, "cp", None)
- if cp is not None:
- return cp
try:
return Atom(mydep).cp