diff options
| author | Robert Collins <robertc@robertcollins.net> | 2013-03-06 23:16:03 +1300 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2013-03-06 23:16:03 +1300 |
| commit | 2c8480561713e524dafa3cbf22156f048f1de585 (patch) | |
| tree | 654c2e1b3161b1ec7150bea04e01688a612a3c6a /python/subunit/__init__.py | |
| parent | 36de6f4f7542b10f93061b65bcf7464a74cb9ddc (diff) | |
| download | subunit-git-2c8480561713e524dafa3cbf22156f048f1de585.tar.gz | |
Fixes from getting testrepository running with v2.
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 5 |
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 |
