[Zope3-checkins] SVN: Zope3/branches/3.3/ - fixed bug that was hiding subsequent ImportErrors in the 'install' generation

Ignas Mikalajunas ignas at pov.lt
Wed Jun 21 09:10:11 EDT 2006


> -            evolver = __import__("%s.install" % self.package_name,
> -                                 {}, {}, ['*'])
> -        except ImportError:
> -            pass
> +            evolver = __import__(name, {}, {}, ['*'])
> +        except ImportError, m:
> +            if str(m) not in ('No module named %s' % name,
> +                              'No module named install'):
> +                # This was an import error *within* the module, so we re-raise.
> +                raise
>          else:
>              evolver.evolve(context)

This fix breaks on cases when module with a name package_name exists
but has no module "install" in it. In that case error message is 'No
module named generations.install' and it is re-raised while it should
not be.

Ignas Mikalajūnas


More information about the Zope3-Checkins mailing list