build: Fix build error with python3

Change-Id: Ie90c6a9856b2616131ff9c0c3916aede1978ea94
Refs: #1302