Tweak Python3 support to help testrepository get 3-ready.
authorRobert Collins <robertc@robertcollins.net>
Sun, 27 Jan 2013 00:55:33 +0000 (13:55 +1300)
committerRobert Collins <robertc@robertcollins.net>
Sun, 27 Jan 2013 00:55:33 +0000 (13:55 +1300)
NEWS
python/subunit/__init__.py

diff --git a/NEWS b/NEWS
index 081dc5dbfccf3ca2ffb020edc58a1604562e56aa..93c87cc64107f99193e69674cf52edb72dc18fe1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,16 @@ subunit release notes
 NEXT (In development)
 ---------------------
 
+BUG FIXES
+~~~~~~~~~
+
+* UnsupportedOperation is available in the Python2.6 io library, so ask
+  forgiveness rather than permission for obtaining it. (Robert Collins)
+
+* Streams with no fileno() attribute are now supported, but they are not
+  checked for being in binary mode: be sure to take care of that if using
+  the library yourself. (Robert Collins)
+
 0.0.9
 -----
 
index 42dcf297e4baeaa124761bbcdd8f820d35aace71..dfc5e9498b3709c88ec891dbf07e6c860ce4fc0a 100644 (file)
@@ -121,9 +121,9 @@ import re
 import subprocess
 import sys
 import unittest
-if sys.version_info > (3, 0):
+try:
     from io import UnsupportedOperation as _UnsupportedOperation
-else:
+except ImportError:
     _UnsupportedOperation = AttributeError
 
 
@@ -1285,7 +1285,7 @@ def _make_stream_binary(stream):
     """
     try:
         fileno = stream.fileno()
-    except _UnsupportedOperation:
+    except (_UnsupportedOperation, AttributeError):
         pass
     else:
         _make_binary_on_windows(fileno)