better check for python 2

same as Flask and Werkzeug