summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2011-04-25 13:10:06 +1200
committerRobert Collins <robertc@robertcollins.net>2011-04-25 13:10:06 +1200
commit4e38ad9bdca35faf281069efede62c181ea8c3b4 (patch)
tree1be189fad24596e6bb5cf2601738e163eeaa4f95 /python
parent511dc0ea9c094c1891c5d220e9e069fd5cd85d29 (diff)
downloadsubunit-4e38ad9bdca35faf281069efede62c181ea8c3b4.tar.gz
Tags in the API are strings. And python3 exception names.
Diffstat (limited to 'python')
-rw-r--r--python/subunit/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index c997296..6e1668e 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -127,7 +127,11 @@ from testtools.compat import _b, _u, BytesIO, StringIO
try:
from testtools.testresult.real import _StringException
RemoteException = _StringException
- _remote_exception_str = '_StringException' # For testing.
+ # For testing: different pythons have different str() implementations.
+ if sys.version_info > (3, 0):
+ _remote_exception_str = 'testtools.testresult.real._StringException'
+ else:
+ _remote_exception_str = '_StringException'
except ImportError:
raise ImportError ("testtools.testresult.real does not contain "
"_StringException, check your version.")
@@ -502,7 +506,7 @@ class TestProtocolServer(object):
def _handleTags(self, offset, line):
"""Process a tags command."""
- tags = line[offset:].split()
+ tags = line[offset:].decode('utf8').split()
new_tags, gone_tags = tags_to_new_gone(tags)
self.client.tags(new_tags, gone_tags)