It was defined twice: in modpython.cpp, and in modpython.i And there is a fake CPyRetString in modpython.i Now both places which use real CPyRetString include the file instead. Fake CPyRetString is still in modpython.i