fix architecture detection for python2 and python3