Python compatibility fix