[Pythonmac-SIG] dbm problems

Jack Jansen jack@oratrix.nl
Wed, 02 Aug 2000 09:57:37 +0200

> At 10:03 AM +0200 8/1/2000, Jack Jansen wrote:
> >Anydbm is one of the few modules that defeats the
> >BuildApplication/freeze method of finding modules used. It's best to
> >help it along a little, and as the only dbm-clone available on the mac
> >is gdbm a bit of code like
> >if 0:
> >     import gdbm
> >somewhere in your code will do the trick.
> [...]
> BTW, what is the if 0 part for?  In fact, if 0 seems like it would 
> always be false, so the import gdbm part would never be run.

That's right: anydbm will import it. The only reason it is there is to fool 
BuildApplication. The way BuildApplication finds all the modules used is 
basically by searching for "import xxxx" and "from xxxx import ..." 
statements. So by putting in such a statement, even if it's inside an if 0, 
BuildApplication will find the module.
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm