aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-07-15 08:06:55 +0200
committerMichał Górny <mgorny@gentoo.org>2020-07-16 04:48:57 +0200
commit5e9fe0f2a5afb71a2aa8425c33103c36bfc1a238 (patch)
tree4ddb9b71c32439df7c58d35e95360a0ae85ce352 /lib/_emerge
parentRemove from __future__ import unicode_literals (diff)
downloadportage-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')
-rw-r--r--lib/_emerge/BinpkgFetcher.py5
-rw-r--r--lib/_emerge/BlockerCache.py19
-rw-r--r--lib/_emerge/BlockerDB.py4
-rw-r--r--lib/_emerge/FakeVartree.py11
-rw-r--r--lib/_emerge/JobStatusDisplay.py7
-rw-r--r--lib/_emerge/Package.py27
-rw-r--r--lib/_emerge/Scheduler.py5
-rw-r--r--lib/_emerge/actions.py21
-rw-r--r--lib/_emerge/create_world_atom.py8
-rw-r--r--lib/_emerge/depgraph.py15
-rw-r--r--lib/_emerge/main.py4
-rw-r--r--lib/_emerge/resolver/output.py26
-rw-r--r--lib/_emerge/resolver/output_helpers.py6
-rw-r--r--lib/_emerge/resolver/slot_collision.py6
14 files changed, 52 insertions, 112 deletions
diff --git a/lib/_emerge/BinpkgFetcher.py b/lib/_emerge/BinpkgFetcher.py
index 2e5861cc1..c26c9bd6b 100644
--- a/lib/_emerge/BinpkgFetcher.py
+++ b/lib/_emerge/BinpkgFetcher.py
@@ -17,9 +17,6 @@ from portage import os
from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
from portage.util._pty import _create_pty_or_pipe
-if sys.hexversion >= 0x3000000:
- long = int
-
class BinpkgFetcher(CompositeTask):
@@ -185,7 +182,7 @@ class _BinpkgFetcherProcess(SpawnProcess):
self.pkg.cpv)].get("_mtime_")
if remote_mtime is not None:
try:
- remote_mtime = long(remote_mtime)
+ remote_mtime = int(remote_mtime)
except ValueError:
pass
else:
diff --git a/lib/_emerge/BlockerCache.py b/lib/_emerge/BlockerCache.py
index 53342d6d6..d0beb46ac 100644
--- a/lib/_emerge/BlockerCache.py
+++ b/lib/_emerge/BlockerCache.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import errno
@@ -13,13 +13,6 @@ try:
except ImportError:
import pickle
-if sys.hexversion >= 0x3000000:
- basestring = str
- long = int
- _unicode = str
-else:
- _unicode = unicode
-
class BlockerCache(portage.cache.mappings.MutableMapping):
"""This caches blockers of installed packages so that dep_check does not
have to be done for every single installed package on every invocation of
@@ -82,7 +75,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
# corruption is detected as soon as possible.
invalid_items = set()
for k, v in self._cache_data["blockers"].items():
- if not isinstance(k, basestring):
+ if not isinstance(k, str):
invalid_items.add(k)
continue
try:
@@ -97,7 +90,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
invalid_items.add(k)
continue
counter, atoms = v
- if not isinstance(counter, (int, long)):
+ if not isinstance(counter, int):
invalid_items.add(k)
continue
if not isinstance(atoms, (list, tuple)):
@@ -105,7 +98,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
continue
invalid_atom = False
for atom in atoms:
- if not isinstance(atom, basestring):
+ if not isinstance(atom, str):
invalid_atom = True
break
if atom[:1] != "!" or \
@@ -164,8 +157,8 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
@param blocker_data: An object with counter and atoms attributes.
@type blocker_data: BlockerData
"""
- self._cache_data["blockers"][_unicode(cpv)] = (blocker_data.counter,
- tuple(_unicode(x) for x in blocker_data.atoms))
+ self._cache_data["blockers"][str(cpv)] = (blocker_data.counter,
+ tuple(str(x) for x in blocker_data.atoms))
self._modified.add(cpv)
def __iter__(self):
diff --git a/lib/_emerge/BlockerDB.py b/lib/_emerge/BlockerDB.py
index 5b3b01c37..6122e73a8 100644
--- a/lib/_emerge/BlockerDB.py
+++ b/lib/_emerge/BlockerDB.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import sys
@@ -13,8 +13,6 @@ from _emerge.BlockerCache import BlockerCache
from _emerge.Package import Package
from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
-if sys.hexversion >= 0x3000000:
- long = int
class BlockerDB(object):
diff --git a/lib/_emerge/FakeVartree.py b/lib/_emerge/FakeVartree.py
index 029aa0ce8..6070aeabb 100644
--- a/lib/_emerge/FakeVartree.py
+++ b/lib/_emerge/FakeVartree.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import sys
@@ -17,11 +17,6 @@ from portage.update import grab_updates, parse_updates, update_dbentries
from portage.versions import _pkg_str
from _emerge.resolver.DbapiProvidesIndex import PackageDbapiProvidesIndex
-if sys.hexversion >= 0x3000000:
- long = int
- _unicode = str
-else:
- _unicode = unicode
class FakeVardbGetPath(object):
"""
@@ -165,7 +160,7 @@ class FakeVartree(vartree):
raise _DynamicDepsNotApplicable()
for k, v in built_slot_operator_atoms.items():
live_metadata[k] += (" " +
- " ".join(_unicode(atom) for atom in v))
+ " ".join(str(atom) for atom in v))
self.dbapi.aux_update(pkg.cpv, live_metadata)
except _DynamicDepsNotApplicable:
@@ -247,7 +242,7 @@ class FakeVartree(vartree):
if pkg is not None:
counter, mtime = real_vardb.aux_get(cpv, validation_keys)
try:
- counter = long(counter)
+ counter = int(counter)
except ValueError:
counter = 0
diff --git a/lib/_emerge/JobStatusDisplay.py b/lib/_emerge/JobStatusDisplay.py
index c44d2ab19..b3160a4cc 100644
--- a/lib/_emerge/JobStatusDisplay.py
+++ b/lib/_emerge/JobStatusDisplay.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import io
@@ -14,9 +14,6 @@ from portage.output import xtermTitle
from _emerge.getloadavg import getloadavg
-if sys.hexversion >= 0x3000000:
- basestring = str
-
class JobStatusDisplay(object):
_bound_properties = ("curval", "failed", "running")
@@ -59,7 +56,7 @@ class JobStatusDisplay(object):
object.__setattr__(self, "_term_codes", term_codes)
encoding = sys.getdefaultencoding()
for k, v in self._term_codes.items():
- if not isinstance(v, basestring):
+ if not isinstance(v, str):
self._term_codes[k] = v.decode(encoding, 'replace')
if self._isatty:
diff --git a/lib/_emerge/Package.py b/lib/_emerge/Package.py
index b1abfb744..76f4066bb 100644
--- a/lib/_emerge/Package.py
+++ b/lib/_emerge/Package.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import functools
@@ -19,13 +19,6 @@ from portage.exception import InvalidData, InvalidDependString
from portage.localization import _
from _emerge.Task import Task
-if sys.hexversion >= 0x3000000:
- basestring = str
- long = int
- _unicode = str
-else:
- _unicode = unicode
-
class Package(Task):
__hash__ = Task.__hash__
@@ -220,7 +213,7 @@ class Package(Task):
else:
raise TypeError("root_config argument is required")
- elements = [type_name, root, _unicode(cpv), operation]
+ elements = [type_name, root, str(cpv), operation]
# For installed (and binary) packages we don't care for the repo
# when it comes to hashing, because there can only be one cpv.
@@ -513,7 +506,7 @@ class Package(Task):
cpv_color = "PKG_NOMERGE"
build_id_str = ""
- if isinstance(self.cpv.build_id, long) and self.cpv.build_id > 0:
+ if isinstance(self.cpv.build_id, int) and self.cpv.build_id > 0:
build_id_str = "-%s" % self.cpv.build_id
s = "(%s, %s" \
@@ -712,7 +705,7 @@ class Package(Task):
@return: True if all flags are valid USE values which may
be specified in USE dependencies, False otherwise.
"""
- if isinstance(flags, basestring):
+ if isinstance(flags, str):
flags = [flags]
for flag in flags:
@@ -725,7 +718,7 @@ class Package(Task):
"""
@return: A list of flags missing from IUSE.
"""
- if isinstance(flags, basestring):
+ if isinstance(flags, str):
flags = [flags]
missing_iuse = []
for flag in flags:
@@ -871,14 +864,14 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
getattr(self, "_set_" + k.lower())(k, v)
def _set_inherited(self, k, v):
- if isinstance(v, basestring):
+ if isinstance(v, str):
v = frozenset(v.split())
self._pkg.inherited = v
def _set_counter(self, k, v):
- if isinstance(v, basestring):
+ if isinstance(v, str):
try:
- v = long(v.strip())
+ v = int(v.strip())
except ValueError:
v = 0
self._pkg.counter = v
@@ -896,9 +889,9 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
pass
def _set__mtime_(self, k, v):
- if isinstance(v, basestring):
+ if isinstance(v, str):
try:
- v = long(v.strip())
+ v = int(v.strip())
except ValueError:
v = 0
self._pkg.mtime = v
diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py
index 4d77d2ab3..7ae9cd4d4 100644
--- a/lib/_emerge/Scheduler.py
+++ b/lib/_emerge/Scheduler.py
@@ -63,9 +63,6 @@ from _emerge.PackageMerge import PackageMerge
from _emerge.PollScheduler import PollScheduler
from _emerge.SequentialTaskQueue import SequentialTaskQueue
-if sys.hexversion >= 0x3000000:
- basestring = str
-
# enums
FAILURE = 1
@@ -1141,7 +1138,7 @@ class Scheduler(PollScheduler):
if phase not in logentries:
continue
for msgtype, msgcontent in logentries[phase]:
- if isinstance(msgcontent, basestring):
+ if isinstance(msgcontent, str):
msgcontent = [msgcontent]
for line in msgcontent:
printer.eerror(line.strip("\n"))
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index 554e60944..dc54372a3 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -94,11 +94,6 @@ from _emerge.UnmergeDepPriority import UnmergeDepPriority
from _emerge.UseFlagDisplay import pkg_use_display
from _emerge.UserQuery import UserQuery
-if sys.hexversion >= 0x3000000:
- long = int
- _unicode = str
-else:
- _unicode = unicode
def action_build(emerge_config, trees=DeprecationWarning,
mtimedb=DeprecationWarning, myopts=DeprecationWarning,
@@ -854,7 +849,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes,
protected_set.add("=" + pkg.cpv)
continue
except portage.exception.InvalidDependString as e:
- show_invalid_depstring_notice(pkg, _unicode(e))
+ show_invalid_depstring_notice(pkg, str(e))
del e
protected_set.add("=" + pkg.cpv)
continue
@@ -907,7 +902,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes,
protected_set.add("=" + pkg.cpv)
continue
except portage.exception.InvalidDependString as e:
- show_invalid_depstring_notice(pkg, _unicode(e))
+ show_invalid_depstring_notice(pkg, str(e))
del e
protected_set.add("=" + pkg.cpv)
continue
@@ -924,7 +919,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes,
if excluded_set.findAtomForPackage(pkg):
required_sets['__excluded__'].add("=" + pkg.cpv)
except portage.exception.InvalidDependString as e:
- show_invalid_depstring_notice(pkg, _unicode(e))
+ show_invalid_depstring_notice(pkg, str(e))
del e
required_sets['__excluded__'].add("=" + pkg.cpv)
@@ -989,14 +984,14 @@ def _calc_depclean(settings, trees, ldpath_mtimes,
# visible in the unevaluated form of the atom. In this
# case, we must display the unevaluated atom, so that
# the user can see the conditional USE deps that would
- # otherwise be invisible. Use Atom(_unicode(atom)) to
+ # otherwise be invisible. Use Atom(str(atom)) to
# test for a package where this case would matter. This
# is not necessarily the same as atom.without_use,
- # since Atom(_unicode(atom)) may still contain some
+ # since Atom(str(atom)) may still contain some
# USE dependencies that remain after evaluation of
# conditionals.
if atom.package and atom != atom.unevaluated_atom and \
- vardb.match(Atom(_unicode(atom))):
+ vardb.match(Atom(str(atom))):
msg.append(" %s (%s) pulled in by:" %
(atom.unevaluated_atom, atom))
else:
@@ -1068,7 +1063,7 @@ def _calc_depclean(settings, trees, ldpath_mtimes,
key=operator.attrgetter('package'))
parent_strs.append("%s requires %s" %
(getattr(parent, "cpv", parent),
- ", ".join(_unicode(atom) for atom in atoms)))
+ ", ".join(str(atom) for atom in atoms)))
parent_strs.sort()
msg = []
msg.append(" %s pulled in by:\n" % (child_node.cpv,))
@@ -1541,7 +1536,7 @@ def action_deselect(settings, trees, opts, atoms):
writemsg_stdout(
">>> %s %s from \"%s\" favorites file...\n" %
- (action_desc, colorize("INFORM", _unicode(atom)),
+ (action_desc, colorize("INFORM", str(atom)),
filename), noiselevel=-1)
if '--ask' in opts:
diff --git a/lib/_emerge/create_world_atom.py b/lib/_emerge/create_world_atom.py
index a7f3e30bf..c4b8ccb69 100644
--- a/lib/_emerge/create_world_atom.py
+++ b/lib/_emerge/create_world_atom.py
@@ -6,10 +6,6 @@ import sys
from portage.dep import Atom, _repo_separator
from portage.exception import InvalidData
-if sys.hexversion >= 0x3000000:
- _unicode = str
-else:
- _unicode = unicode
def create_world_atom(pkg, args_set, root_config, before_install=False):
"""Create a new atom for the world file if one does not exist. If the
@@ -43,7 +39,7 @@ def create_world_atom(pkg, args_set, root_config, before_install=False):
for cpv in portdb.match(Atom(cp)):
for repo in repos:
try:
- available_slots.add(portdb._pkg_str(_unicode(cpv), repo).slot)
+ available_slots.add(portdb._pkg_str(str(cpv), repo).slot)
except (KeyError, InvalidData):
pass
@@ -98,7 +94,7 @@ def create_world_atom(pkg, args_set, root_config, before_install=False):
for repo in repos:
try:
matched_slots.add(
- portdb._pkg_str(_unicode(cpv), repo).slot)
+ portdb._pkg_str(str(cpv), repo).slot)
except (KeyError, InvalidData):
pass
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
diff --git a/lib/_emerge/main.py b/lib/_emerge/main.py
index 95855ef2d..727e6d368 100644
--- a/lib/_emerge/main.py
+++ b/lib/_emerge/main.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -22,8 +22,6 @@ portage.proxy.lazyimport.lazyimport(globals(),
from portage import os
from portage.sync import _SUBMODULE_PATH_MAP
-if sys.hexversion >= 0x3000000:
- long = int
options=[
"--alphabetical",
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 29fd034e9..0dace853e 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
"""Resolver output display operation.
@@ -32,12 +32,6 @@ from _emerge.resolver.output_helpers import ( _DisplayConfig, _tree_display,
_PackageCounters, _create_use_string, _calc_changelog, PkgInfo)
from _emerge.show_invalid_depstring_notice import show_invalid_depstring_notice
-if sys.hexversion >= 0x3000000:
- basestring = str
- _unicode = str
-else:
- _unicode = unicode
-
class Display(object):
"""Formats and outputs the depgrah supplied it for merge/re-merge, etc.
@@ -86,19 +80,19 @@ class Display(object):
addl = "%s " % (colorize(self.blocker_style, "B"),)
addl += self.empty_space_in_brackets()
self.resolved = dep_expand(
- _unicode(blocker.atom).lstrip("!"), mydb=self.vardb,
+ str(blocker.atom).lstrip("!"), mydb=self.vardb,
settings=self.pkgsettings
)
if self.conf.columns and self.conf.quiet:
- addl += " " + colorize(self.blocker_style, _unicode(self.resolved))
+ addl += " " + colorize(self.blocker_style, str(self.resolved))
else:
addl = "[%s %s] %s%s" % \
(colorize(self.blocker_style, "blocks"),
addl, self.indent,
- colorize(self.blocker_style, _unicode(self.resolved))
+ colorize(self.blocker_style, str(self.resolved))
)
block_parents = self.conf.blocker_parents.parent_nodes(blocker)
- block_parents = set(_unicode(pnode.cpv) for pnode in block_parents)
+ block_parents = set(str(pnode.cpv) for pnode in block_parents)
block_parents = ", ".join(block_parents)
if blocker.atom.blocker.overlap.forbid:
blocking_desc = "hard blocking"
@@ -107,7 +101,7 @@ class Display(object):
if self.resolved != blocker.atom:
addl += colorize(self.blocker_style,
" (\"%s\" is %s %s)" %
- (_unicode(blocker.atom).lstrip("!"),
+ (str(blocker.atom).lstrip("!"),
blocking_desc, block_parents))
else:
addl += colorize(self.blocker_style,
@@ -314,7 +308,7 @@ class Display(object):
depstr, = db.aux_get(pkg.cpv,
["SRC_URI"], myrepo=pkg.repo)
show_invalid_depstring_notice(
- pkg, _unicode(e))
+ pkg, str(e))
raise
except SignatureException:
# missing/invalid binary package SIZE signature
@@ -445,7 +439,7 @@ class Display(object):
ver_str = self._append_slot(ver_str, pkg, pkg_info)
ver_str = self._append_repository(ver_str, pkg, pkg_info)
if self.conf.quiet:
- myprint = _unicode(pkg_info.attr_display) + " " + self.indent + \
+ myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
myprint = myprint+darkblue(" "+ver_str)+" "
myprint = myprint+pkg_info.oldbest
@@ -484,7 +478,7 @@ class Display(object):
ver_str = self._append_slot(ver_str, pkg, pkg_info)
ver_str = self._append_repository(ver_str, pkg, pkg_info)
if self.conf.quiet:
- myprint = _unicode(pkg_info.attr_display) + " " + self.indent + \
+ myprint = str(pkg_info.attr_display) + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
myprint = myprint+" "+green(ver_str)+" "
myprint = myprint+pkg_info.oldbest
@@ -541,7 +535,7 @@ class Display(object):
@param show_repos: bool.
"""
for msg in self.print_msg:
- if isinstance(msg, basestring):
+ if isinstance(msg, str):
writemsg_stdout("%s\n" % (msg,), noiselevel=-1)
continue
myprint, self.verboseadd, repoadd = msg
diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index 2d4fd788c..4279590dc 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
"""Contains private support functions for the Display class
@@ -28,10 +28,6 @@ from _emerge.Blocker import Blocker
from _emerge.Package import Package
-if sys.hexversion >= 0x3000000:
- basestring = str
-
-
class _RepoDisplay(object):
def __init__(self, roots):
self._shown_repos = {}
diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index be584ec39..0bed08785 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -16,8 +16,6 @@ from portage._sets.base import InternalPackageSet
from portage.util import writemsg
from portage.versions import cpv_getversion, vercmp
-if sys.hexversion >= 0x3000000:
- basestring = str
class slot_conflict_handler(object):
"""This class keeps track of all slot conflicts and provides
@@ -1125,7 +1123,7 @@ class _solution_candidate_generator(object):
def __init__(self, value=None):
self.value = value
def __eq__(self, other):
- if isinstance(other, basestring):
+ if isinstance(other, str):
return self.value == other
else:
return self.value == other.value