summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dep/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 8332a05e4..862154318 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -30,7 +30,7 @@ __all__ = [
import re, sys
import warnings
from itertools import chain
-import portage.exception
+from portage import _unicode_decode
from portage.eapi import eapi_has_slot_deps, eapi_has_src_uri_arrows, \
eapi_has_use_deps, eapi_has_strong_blocks, eapi_has_use_dep_defaults
from portage.exception import InvalidAtom, InvalidData, InvalidDependString
@@ -1057,6 +1057,10 @@ class Atom(_atom_base):
raise TypeError(_("Expected %s, got %s") % \
(_atom_base, type(s)))
+ if not isinstance(s, _atom_base):
+ # Avoid TypeError with from _atom_base.__init__ with PyPy.
+ s = _unicode_decode(s)
+
_atom_base.__init__(s)
if "!" == s[:1]: