c_platform: fix compatibility with python3