summaryrefslogtreecommitdiff
path: root/python/subunit/__init__.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2013-03-06 23:16:03 +1300
committerRobert Collins <robertc@robertcollins.net>2013-03-06 23:16:03 +1300
commit6f4a13700850e83a55ba9851a86276c75c80dd21 (patch)
tree654c2e1b3161b1ec7150bea04e01688a612a3c6a /python/subunit/__init__.py
parent187d5bfa4c441b03ca2a85446bf6c993665c40b4 (diff)
downloadsubunit-6f4a13700850e83a55ba9851a86276c75c80dd21.tar.gz
Fixes from getting testrepository running with v2.
Diffstat (limited to 'python/subunit/__init__.py')
-rw-r--r--python/subunit/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py
index ad749ff..7470f92 100644
--- a/python/subunit/__init__.py
+++ b/python/subunit/__init__.py
@@ -126,7 +126,7 @@ try:
except ImportError:
_UnsupportedOperation = AttributeError
-
+from extras import safe_hasattr
from testtools import content, content_type, ExtendedToOriginalDecorator
from testtools.content import TracebackContent
from testtools.compat import _b, _u, BytesIO, StringIO
@@ -1268,7 +1268,8 @@ def get_default_formatter():
else:
stream = sys.stdout
if sys.version_info > (3, 0):
- stream = stream.buffer
+ if safe_hasattr(stream, 'buffer'):
+ stream = stream.buffer
return stream