Catching Parse Error from ElementTree
#1
I'm updating some of the error catching on Artist Slideshow, and I've run into a problem. If AS gets back a malformed XML file from a couple services, it crashes and reports a ParseError from ElementTree. But when I try and catch it I get an error saying that the module doesn't have that.

I load ElementTree like this:
Code:
import xml.etree.ElementTree as _xmltree

and then try and catch the error with:
Code:
except _xmltree.ParseError:

For now I'm doing the really nasty except with no condition thing. That's less than ideal, and I'd like to figure out what's causing this.

If you'd like more context, the project is on github at https://github.com/pkscout/script.artistslideshow and one of the files that does this is resources/plugins/htbackdrops.py. Would it matter that the main default.py imports the stuff from the plugin folder?
Reply

Logout Mark Read Team Forum Stats Members Help
Catching Parse Error from ElementTree0