sloonz/pil-py3k — pull request #2 by smarnach (2012-04-02 23:44:02+00:00)
Title: Use explicit relative imports everywhere

Since implicit relative imports aren't available in Python 3, all
package-internal imports in PIL were absolute imports for the named
module. This meant that import Image as

from PIL import Image

did not work correctly. It imports the module 'PIL.Image', and is
registered in 'sys.modules' under that name. Since all plugins use
absolute imports, they import a module named 'Image', which will be a
separate entry in 'sys.modules'. In consequence, the original import
cannot see any of the plugins.

This patch changes all imports to explicit relative imports. At least
one import cycle that happened to work before had to be resolved,
maybe there are more. The patch did not receive too much testing, but
made things work for me.