fixed pygments to work with Python3
fixed exception handling for python3
fixed print statements for python3