diff options
author | 2020-07-15 08:06:55 +0200 | |
---|---|---|
committer | 2020-07-16 04:48:57 +0200 | |
commit | 5e9fe0f2a5afb71a2aa8425c33103c36bfc1a238 (patch) | |
tree | 4ddb9b71c32439df7c58d35e95360a0ae85ce352 /lib/_emerge/depgraph.py | |
parent | Remove from __future__ import unicode_literals (diff) | |
download | portage-5e9fe0f2a5afb71a2aa8425c33103c36bfc1a238.tar.gz portage-5e9fe0f2a5afb71a2aa8425c33103c36bfc1a238.tar.bz2 portage-5e9fe0f2a5afb71a2aa8425c33103c36bfc1a238.zip |
Eliminate basestring/long/_unicode py3 compat
Replace basestring and _unicode hacks with str, and long with int.
Reviewed-by: Zac Medico <zmedico@gentoo.org>
Closes: https://github.com/gentoo/portage/pull/570
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'lib/_emerge/depgraph.py')
-rw-r--r-- | lib/_emerge/depgraph.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py index 795cf69d6..dbfb8b0ee 100644 --- a/lib/_emerge/depgraph.py +++ b/lib/_emerge/depgraph.py @@ -88,13 +88,6 @@ from _emerge.resolver.slot_collision import slot_conflict_handler from _emerge.resolver.circular_dependency import circular_dependency_handler from _emerge.resolver.output import Display, format_unmatched_atom -if sys.hexversion >= 0x3000000: - basestring = str - long = int - _unicode = str -else: - _unicode = unicode - # Exposes a depgraph interface to dep_check. _dep_check_graph_interface = collections.namedtuple('_dep_check_graph_interface',( # Indicates a removal action, like depclean or prune. @@ -311,7 +304,7 @@ class _rebuild_config(object): ["BUILD_TIME"]) except KeyError: continue - if bin_build_time != _unicode(parent.build_time): + if bin_build_time != str(parent.build_time): # 2) Remote binary package is valid, and local package # is not up to date. Force reinstall. reinstall = True @@ -5761,7 +5754,7 @@ class depgraph(object): other_installed, other_keys in dbs: try: if portage.dep._match_slot(atom, - other_db._pkg_str(_unicode(cpv), None)): + other_db._pkg_str(str(cpv), None)): slot_available = True break except (KeyError, InvalidData): @@ -9263,7 +9256,7 @@ class depgraph(object): filename = "world" writemsg_stdout( ">>> Recording %s in \"%s\" favorites file...\n" % - (colorize("INFORM", _unicode(a)), filename), noiselevel=-1) + (colorize("INFORM", str(a)), filename), noiselevel=-1) world_set.update(all_added) if world_locked: @@ -9458,7 +9451,7 @@ class depgraph(object): depgraph_sets = self._dynamic_config.sets[root_config.root] args = [] for x in favorites: - if not isinstance(x, basestring): + if not isinstance(x, str): continue if x in ("system", "world"): x = SETPREFIX + x |