remove compatibility for hasattr && autopep8

`hasattr` has in > python2.6.