My old code with python 2 has
import array
buf = array.array('c')
In python 3, this chunk of code gives error
E ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)
What would be the equivalent in python 3? How to make the code work for both python 2 and 3?