quick fix sudo installer put file in /root/ bug
[rainbowstream.git] / rainbowstream / py3patch.py
CommitLineData
c3bab4ef 1"""
2 Python 3 supports
3"""
4import sys
5
6# StringIO module
7try:
77f1d210 8 from StringIO import StringIO, BytesIO
c3bab4ef 9except:
77f1d210 10 from io import StringIO, BytesIO
c3bab4ef 11
b2cde062 12# HTMLParser module
b2cde062
BR
13try:
14 from HTMLParser import HTMLParser
a8c5fce4 15 unescape = HTMLParser().unescape
b2cde062 16except:
18df6e7f 17 from html import unescape
b2cde062 18
b13c6a0d 19# raw_input and map function behaviour
422dd385 20if sys.version[0] == "3":
c3bab4ef 21 raw_input = input
422dd385 22 lmap = lambda f, a: list(map(f, a))
c3bab4ef 23else:
422dd385 24 lmap = lambda f, a: map(f, a)