fix degree.py bug