adapt to py 3.2