Update compass.py

fix "global name is not defined" error.