更新时间:2023-12-01 21:40:22
您需要正确引用该异常.
You need to reference the exception correctly.
直接将异常导入模块中,或使用完整的参考文献:
Either import the exception directly into your module, or use the full reference:
import gpxpy.gpx
try:
# ...
except gpxpy.gpx.GPSException:
# ...
或
from gpxpy.gpx import GPSException
try:
# ...
except GPSException:
# ...