build,json: fix compatibility with Python 3.5