changeset 129:85c8877f4c16

py3
author Jeff Hammel <k0scist@gmail.com>
date Tue, 03 Nov 2020 15:02:24 -0800
parents 7cccddcd8b9d
children fbcbcd36329e
files bitsyblog/parser.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/parser.py	Tue Nov 03 15:00:44 2020 -0800
+++ b/bitsyblog/parser.py	Tue Nov 03 15:02:24 2020 -0800
@@ -32,7 +32,12 @@
 try:
     from cStringIO import StringIO
 except ImportError:
-    from StringIO import StringIO
+    try:
+        # python2
+        from StringIO import StringIO
+    except ImportError:
+        # python3
+        from io import StringIO
 
 class _timelex:
     def __init__(self, instream):