diff options
author | Marius Gedminas <marius@gedmin.as> | 2013-02-07 23:04:56 +0000 |
---|---|---|
committer | Marius Gedminas <marius@gedmin.as> | 2013-02-07 23:04:56 +0000 |
commit | cec5452b6cb93ed0d0139be1d01aa660e14b3bbb (patch) | |
tree | d1e4eed56d64c239e1a9f80a01f47480a18c6f06 /src/zope/tal/runtest.py | |
parent | 040631594cdcf3edb55e35e80bb0b6ef1ba66921 (diff) | |
download | zope-tal-cec5452b6cb93ed0d0139be1d01aa660e14b3bbb.tar.gz |
Towards Py3K: use io.StringIO
While Python 2.6+ also has io.StringIO(), using it causes numerous test
failures -- because io.StringIO() insists on unicode, and our tests are
full of (ASCII-only) native string literals. For this reason I decided
to keep using StringIO.StringIO or cStringIO.StringIO on Python 2.x.
Diffstat (limited to 'src/zope/tal/runtest.py')
-rw-r--r-- | src/zope/tal/runtest.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/zope/tal/runtest.py b/src/zope/tal/runtest.py index 5c50e52..fb002b8 100644 --- a/src/zope/tal/runtest.py +++ b/src/zope/tal/runtest.py @@ -23,7 +23,12 @@ import sys import traceback import difflib -from cStringIO import StringIO +try: + # Python 2.x + from cStringIO import StringIO +except ImportError: + # Python 3.x + from io import StringIO if __name__ == "__main__": from . import setpath # Local hack to tweak sys.path etc. |