fix python3 compatibility by replacing use of print as statement