[Pythonmac-SIG] Py2app PIL recipe

Ronald Oussoren ronaldoussoren at mac.com
Thu Nov 26 10:58:40 CET 2009


On 24 Nov, 2009, at 23:08, Christopher Barker wrote:

> 
> 
> Ronald Oussoren wrote:
> 
>>> No harm in having both ways, though.
>> I'm not 100% sure about that though, users may now end up with two copies of PIL unless they remove the .pth file as well. That wouldn't be a disaster, but I'd prefer to avoid that.
> 
> hmm -- I suppose we should check that. I agree that it's probably not a good idea to have the contents of the package also in sys.path, but that's how PIL is installed now. It seems that users could have it imported in two different ways in their own code, regardless of how py2app imports it.
> 
> I guess the question is whether modulegraph is smart enough to realize that they are the same thing!

The aren't according to the python rules: if you import both PIL.Image and Image you get two distinct modules in sys.modules (that is, sys.modules['Image'] is not sys.modules['PIL.Image']).  PIL isn't too large, adding it twice won't really be a problem but it would be nice to avoid this issue.

Ronald

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3567 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pythonmac-sig/attachments/20091126/79eebbd6/attachment-0001.bin>


More information about the Pythonmac-SIG mailing list