aboutsummaryrefslogtreecommitdiffstats
path: root/tests/util/py3xfunctions.py
blob: 4b8d8015457e1c8cc832c828d670032bf016a194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def b(s):
    if type(s) == bytes:
        return s
    return bytes(s, "UTF8")

def buffer_(s):
    if s == None:
        return None
    elif type(s) == str:
        return bytes(s, "UTF8")
    elif type(s) == bytes:
        return s
    else:
        memoryview(s)

def l(n):
    return n

def unicode_(s):
    return s

unicode = str
unichr = chr
long = int
unichr = chr
buffer = buffer_