fix more excepts for python2.x and python3.x compatability