Corrected the exception handling to be compatible with both python 2 and 3
Corrected the exception handling to be compatible with both python 2 and 3

yashu-seth/BinPy,rajathkumarmp/BinPy,BinPy/BinPy,daj0ker/BinPy,rajathkumarmp/BinPy,yashu-seth/BinPy,BinPy/BinPy,daj0ker/BinPy