make api test run under Python 3