Mercurial > hg > bitsyblog
comparison bitsyblog/parser.py @ 129:85c8877f4c16
py3
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 03 Nov 2020 15:02:24 -0800 |
parents | 7cccddcd8b9d |
children |
comparison
equal
deleted
inserted
replaced
128:7cccddcd8b9d | 129:85c8877f4c16 |
---|---|
30 # http://stein.cshl.org/jade/distrib/docs/java.text.SimpleDateFormat.html | 30 # http://stein.cshl.org/jade/distrib/docs/java.text.SimpleDateFormat.html |
31 | 31 |
32 try: | 32 try: |
33 from cStringIO import StringIO | 33 from cStringIO import StringIO |
34 except ImportError: | 34 except ImportError: |
35 from StringIO import StringIO | 35 try: |
36 # python2 | |
37 from StringIO import StringIO | |
38 except ImportError: | |
39 # python3 | |
40 from io import StringIO | |
36 | 41 |
37 class _timelex: | 42 class _timelex: |
38 def __init__(self, instream): | 43 def __init__(self, instream): |
39 if isinstance(instream, basestring): | 44 if isinstance(instream, basestring): |
40 instream = StringIO(instream) | 45 instream = StringIO(instream) |