« Previous | Next » 

Revision d6f8db24


Added by Guido Trotter over 12 years ago

Fix unittest failures with python 2.7

In python 2.7 the ovf unittests fail because OVFReader expects
ElementTree.parse() of an erroneous document to throw an
xml.parsers.expat.ExpatError while instead it throws an

The solution is to "except" for both errors, with the catch that
ParseError didn't exist before, so we need to define it locally and
get it from the module if it exists, while leaving it set to "None"
(thus catching no exception) if it does not.

Signed-off-by: Guido Trotter <>
Reviewed-by: Agata Murawska <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences