[PATCH stable] hook: disable demandimport before importing hooks

Dirkjan Ochtman dirkjan at ochtman.nl
Mon Dec 17 06:14:36 CST 2012


On Mon, Dec 17, 2012 at 12:45 PM, Dirkjan Ochtman <dirkjan at ochtman.nl> wrote:
> # HG changeset patch
> # User Dirkjan Ochtman <dirkjan at ochtman.nl>
> # Date 1355744565 -3600
> # Node ID 50352cc4c0560f1e3e49c78c8070a5dadac950c8
> # Parent  e853d27956fb0a25dcaac29b18bb0d5719297830
> hook: disable demandimport before importing hooks

This solved an obscure bug for me. In upgrading Distribute on the
server, a patch was added to has a try: import a except ImportError
thing that's only supposed to work with Python 3.3. I'm using 2.7. My
hook failed with an ImportError because of this. It seems kind of
sensible to turn off demandimport before importing the hook. I've also
submitted a patch with Distribute to make them do something less stupid:

https://bitbucket.org/tarek/distribute/pull-request/32/minimize-impact-of-namespace-package/diff

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list