@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:
@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