use exception as to support python3
replate the print with print()
change the exception with as to support python3