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:
# ...
or
from gpxpy.gpx import GPSException
try:
# ...
except GPSException:
# ...