[Python-Dev] Freeze hacks
Wed, 18 Jul 2001 17:32:37 +0200
From: "Martin von Loewis" <email@example.com>
> A number of modules in the standard library make use of dynamic
> imports, or import modules through C code. In either case, no import
> statement can be found.
> Unfortunately, this means that tools like freeze or py2exe cannot
> detect that those modules are used, so the frozen applications will
> then fail at runtime. To make this work, I suggest to add explicit
> import statements, which are put into a conditional 'if 0:'.
Very good idea IMO, but 'if 0:' is optimized away.
This one works: