Hi folks,

For a while now, PIL has provided a proper package, so that you can do:

from PIL import Image

rather than relying on a pth file and:

import Image


I'm such a fanatic about "proper" use of packages and namespaces that I removed the PIL.pth file from my system.

Then I tried to use py2app on a program that uses PIL. It turns out that the PIL py2app recipe has a prescript.py file that gets put into the bundle, and it uses the old "import Image" form.

I've hacked it to use:

    try:
        import Image
    except ImportError:
        from PIL import Image # note: the newer way to import PIL
    import sys

instead, which works fine for me.

I'd really rather simple use the package form:

   from PIL import Image # note: the newer way to import PIL

all by itself, but there is some chance that that would break older PIL installations -- or is there? when was the PIL directory made a package?

Anyway, could someone with SVN access to py2app please make this small patch. (I've enclosed the whole file, to make it easy).

It belongs in:

py2app/recipes/PIL/prescript.py


Thanks,
-Chris





--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

chris.bar...@noaa.gov

Attachment: prescript.py
Description: application/python

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to