Improve Python compatibility of build file.