cortesi/mitmproxy — pull request #69 by mat128 (2012-11-23 16:56:40+00:00)
Title: PIL imports -- packaging

PIL documents two different way to import it's modules:
* import Image [1]
* from PIL import Image [2]

I changed contentview so that it imports using one way then tries the other way. This is similar to what people do with simplejson vs json. Django users also noted the problem [3] and the fix was similar to what I propose here.

[1] http://www.pythonware.com/library/pil/handbook/introduction.htm
[2] http://www.pythonware.com/library/pil/handbook/image.htm
[3] https://code.djangoproject.com/ticket/6054