Commit | Line | Data |
---|---|---|
c3bab4ef | 1 | """ |
2 | Python 3 supports | |
3 | """ | |
4 | import sys | |
5 | ||
6 | # StringIO module | |
7 | try: | |
77f1d210 | 8 | from StringIO import StringIO, BytesIO |
c3bab4ef | 9 | except: |
77f1d210 | 10 | from io import StringIO, BytesIO |
c3bab4ef | 11 | |
b2cde062 BR |
12 | # HTMLParser module |
13 | ||
14 | try: | |
15 | from HTMLParser import HTMLParser | |
16 | except: | |
17 | from html.parser import HTMLParser | |
18 | ||
c3bab4ef | 19 | # raw_input and map functiion behaviour |
422dd385 | 20 | if sys.version[0] == "3": |
c3bab4ef | 21 | raw_input = input |
422dd385 | 22 | lmap = lambda f, a: list(map(f, a)) |
c3bab4ef | 23 | else: |
422dd385 | 24 | lmap = lambda f, a: map(f, a) |