aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKirill Simonov <xi@resolvent.net>2008-12-30 14:55:47 +0000
committerKirill Simonov <xi@resolvent.net>2008-12-30 14:55:47 +0000
commite2bf4f3a03aa581aa70841f1cdc4d484c9e2ee46 (patch)
treeb6ec42f8be12edffaff86b2b16d592106a52e827 /tests
parentbf272b0339eae58dc150b27de73f1a301fb32871 (diff)
downloadpyyaml-e2bf4f3a03aa581aa70841f1cdc4d484c9e2ee46.tar.gz
Minor compatibility fixes.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/test_input_output.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/lib/test_input_output.py b/tests/lib/test_input_output.py
index 311d0cf..0e9621e 100644
--- a/tests/lib/test_input_output.py
+++ b/tests/lib/test_input_output.py
@@ -4,7 +4,13 @@ import codecs, StringIO
def _unicode_open(file, encoding, errors='strict'):
info = codecs.lookup(encoding)
- srw = codecs.StreamReaderWriter(file, info.streamreader, info.streamwriter, errors)
+ if isinstance(info, tuple):
+ reader = info[2]
+ writer = info[3]
+ else:
+ reader = info.streamreader
+ writer = info.streamwriter
+ srw = codecs.StreamReaderWriter(file, reader, writer, errors)
srw.encoding = encoding
return srw