Workaround for PIL's ambiguious import method and/or easy_install PIL packaging problem.

PIL documents two different way to import it's modules:
* import Image (http://www.pythonware.com/library/pil/handbook/introduction.htm)
* from PIL import Image (http://www.pythonware.com/library/pil/handbook/image.htm)

The same problem was noted in Django at https://code.djangoproject.com/ticket/6054
This commit is contained in:
Mathieu Mitchell 2012-11-23 11:48:24 -05:00
parent 75ce5772ea
commit 15c367ffb4

View file

@ -1,7 +1,12 @@
import re, cStringIO, traceback, json
import urwid
from PIL import Image
from PIL.ExifTags import TAGS
try: from PIL import Image
except ImportError: import Image
try: from PIL.ExifTags import TAGS
except ImportError: from ExifTags import TAGS
import lxml.html, lxml.etree
import netlib.utils
import common