This is an archive of the discontinued Mercurial Phabricator instance.

zope: force module import by importing symbols
ClosedPublic

Authored by indygreg on Mar 30 2018, 4:53 PM.

Details

Summary

Previously, we tried to import a module and handle the ImportError.
Our lazy module importer doesn't verify the module exists and returns
a dummy object representing the module. Only once we attempt to load
a symbol in the module does the ImportError get raises.

This means that simple imports inside try..except ImportError don't
detect missing modules.

This commit changes imports in zope.interface to access symbols, thus
forcing module load and triggering ImportError.

This fixes zope.interface for pure builds.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Mar 30 2018, 4:53 PM
martinvonz accepted this revision.Mar 30 2018, 4:57 PM
This revision is now accepted and ready to land.Mar 30 2018, 4:57 PM
This revision was automatically updated to reflect the committed changes.