Fix #10466 and get TestPythonImporter working again.

Fixes http://trac.openmicroscopy.org.uk/ome/ticket/10466 and also makes `TestPythonImporter` tests all pass.

See discussion on https://github.com/joshmoore/openmicroscopy/commit/17916d0bf748ea09bb798d3affa7540d6f4ece5a