fixing compatability with both pypy and cpython