[Pythonmac-SIG] trouble making a standalone app with Python 2.4
Kevin Dangoor
kid at kendermedia.com
Wed Feb 23 17:30:24 CET 2005
Bob Ippolito wrote:
> I probably won't be able to look at this until tomorrow, but try
> comparing sys.modules.keys() between your environment with py2app -A
> and py2app.
in getRunLoop, I added print sys.modules.keys() and then ran the Web
Services Tool with and without -A.
Without -A (normal standalone app), the following had been imported.
They were not imported with -A:
'AppKit.imp',
'AppKit.os',
'AppKit.sys',
'Foundation.imp',
'objc.imp',
'objc.sys',
'twisted.internet.imp',
'twisted.protocols.cStringIO',
'twisted.protocols.imp',
'twisted.protocols.os',
'zlib',
'zope.interface.imp',
'zope.interface.os',
I'm guessing that the "imp"s here are probably something special and
automatic that py2app does.
Probably more relevant is the list of things that were imported with -A,
but not without:
'Carbon.CF',
'Carbon._CF',
'_CF',
Seeing this, I added an explicit import for these in one of my modules.
And it worked! Your intuition about the WebKit problem may have been on
track. Just as with that case, these imports were ultimately getting
called from within a block. Putting them at the module level fixed it.
Thanks for the suggestion of looking at sys.modules! I don't think that
I was an avenue I would have gone down.
Kevin
More information about the Pythonmac-SIG
mailing list