bumped veresion
[rainbowstream.git] / rainbowstream / py3patch.py
1 """
2 Python 3 supports
3 """
4 import sys
5
6 # StringIO module
7 try:
8 from StringIO import StringIO, BytesIO
9 except:
10 from io import StringIO, BytesIO
11
12 # HTMLParser module
13 try:
14 from HTMLParser import HTMLParser
15 unescape = HTMLParser().unescape
16 except:
17 from html import unescape
18
19 # raw_input and map function behaviour
20 if sys.version[0] == "3":
21 raw_input = input
22 lmap = lambda f, a: list(map(f, a))
23 else:
24 lmap = lambda f, a: map(f, a)