Skip to content
Snippets Groups Projects
Commit 2a7758c1 authored by Donald Stufft's avatar Donald Stufft
Browse files

Add a six.StringFixer which does the right thing with __str__

parent fc8aadf3
No related branches found
No related tags found
No related merge requests found
...@@ -390,3 +390,13 @@ _add_doc(reraise, """Reraise an exception.""") ...@@ -390,3 +390,13 @@ _add_doc(reraise, """Reraise an exception.""")
def with_metaclass(meta, base=object): def with_metaclass(meta, base=object):
"""Create a base class with a metaclass.""" """Create a base class with a metaclass."""
return meta("NewBase", (base,), {}) return meta("NewBase", (base,), {})
# PyNaCl additions
class StringFixer(object):
def __str__(self):
if PY3:
return self.__unicode__()
else:
return self.__bytes__()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment