Fix for cpython 2.7 runtime error