Fix stderr/stdout print format for Python2