py23.py revision 503179f2ed6416a719c1caea90a7882519bedfa9
1"""Python 2/3 compat layer."""
2
3try:
4	basestring
5except NameError:
6	basestring = str
7
8try:
9	unicode
10except NameError:
11	unicode = str
12
13try:
14	unichr
15	bytechr = chr
16except:
17	unichr = chr
18	def bytechr(n):
19		return bytes([n])
20
21try:
22	from cStringIO import StringIO
23except ImportError:
24	from io import StringIO
25