tools: Fix print calls to be compatible with 3.x