From 71235479ab208318dff391420f9695f5cfaa9594 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 18 Jan 2013 13:33:08 -0800 Subject: Use unicode_literals more. This helps to ensure consistent results, regardless of whether we're using Python 2 or Python 3. --- pym/portage/dep/__init__.py | 2 ++ pym/portage/dep/_slot_operator.py | 4 +++- pym/portage/dep/dep_check.py | 11 ++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'pym/portage/dep') diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py index 67383e882..511753116 100644 --- a/pym/portage/dep/__init__.py +++ b/pym/portage/dep/__init__.py @@ -2,6 +2,8 @@ # Copyright 2003-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +from __future__ import unicode_literals + __all__ = [ 'Atom', 'best_match_to_list', 'cpvequal', 'dep_getcpv', 'dep_getkey', 'dep_getslot', diff --git a/pym/portage/dep/_slot_operator.py b/pym/portage/dep/_slot_operator.py index 2fcfb48b3..7b6444403 100644 --- a/pym/portage/dep/_slot_operator.py +++ b/pym/portage/dep/_slot_operator.py @@ -1,6 +1,8 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +from __future__ import unicode_literals + from portage.dep import Atom, paren_enclose, use_reduce from portage.eapi import _get_eapi_attrs from portage.exception import InvalidData diff --git a/pym/portage/dep/dep_check.py b/pym/portage/dep/dep_check.py index b5f8d0d7e..6e3d0865a 100644 --- a/pym/portage/dep/dep_check.py +++ b/pym/portage/dep/dep_check.py @@ -1,12 +1,13 @@ -# Copyright 2010-2012 Gentoo Foundation +# Copyright 2010-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +from __future__ import unicode_literals + __all__ = ['dep_check', 'dep_eval', 'dep_wordreduce', 'dep_zapdeps'] import logging import portage -from portage import _unicode_decode from portage.dep import Atom, match_from_list, use_reduce from portage.exception import InvalidDependString, ParseError from portage.localization import _ @@ -183,7 +184,7 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/", del mytrees["virt_parent"] if not mycheck[0]: - raise ParseError(_unicode_decode("%s: %s '%s'") % \ + raise ParseError("%s: %s '%s'" % \ (pkg, mycheck[1], depstring)) # pull in the new-style virtual @@ -605,7 +606,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, masklist=mymasks, matchall=(use=="all"), excludeall=useforce, opconvert=True, token_class=Atom, eapi=eapi) except InvalidDependString as e: - return [0, _unicode_decode("%s") % (e,)] + return [0, "%s" % (e,)] if mysplit == []: #dependencies were reduced to nothing @@ -619,7 +620,7 @@ def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None, use_force=useforce, use_mask=mymasks, use_cache=use_cache, use_binaries=use_binaries, myroot=myroot, trees=trees) except ParseError as e: - return [0, _unicode_decode("%s") % (e,)] + return [0, "%s" % (e,)] mysplit2=mysplit[:] mysplit2=dep_wordreduce(mysplit2,mysettings,mydbapi,mode,use_cache=use_cache) -- cgit v1.2.3-1-g7c22