From e9c2c0ac3a845078ee908ecc6997e24b9f8fe291 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Fri, 3 Jan 2014 21:03:58 +0100 Subject: [PATCH 1/2] Migrate from Pil to the latest version of Pillow. --- libmproxy/console/contentview.py | 7 ++----- requirements.txt | 4 ++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libmproxy/console/contentview.py b/libmproxy/console/contentview.py index 8dd8ad1d3..962b49de2 100644 --- a/libmproxy/console/contentview.py +++ b/libmproxy/console/contentview.py @@ -1,11 +1,8 @@ import re, cStringIO, traceback, json import urwid -try: from PIL import Image -except ImportError: import Image - -try: from PIL.ExifTags import TAGS -except ImportError: from ExifTags import TAGS +from PIL import Image +from PIL.ExifTags import TAGS import lxml.html, lxml.etree import netlib.utils diff --git a/requirements.txt b/requirements.txt index ff149240d..52add1264 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Flask>=0.9 Jinja2>=2.7 MarkupSafe>=0.18 -PIL>=1.1.7 +Pillow>=2.3.0,<2.4 Werkzeug>=0.8.3 lxml>=3.2.1 netlib>=0.9.2 @@ -13,4 +13,4 @@ pyasn1>=0.1.7 requests>=1.2.2 urwid>=1.1.1 wsgiref>=0.1.2 -jsbeautifier>=1.4.0 \ No newline at end of file +jsbeautifier>=1.4.0 diff --git a/setup.py b/setup.py index 8dbc6135f..3c126a0e0 100644 --- a/setup.py +++ b/setup.py @@ -97,7 +97,7 @@ setup( "urwid>=1.1", "pyasn1>0.1.2", "pyopenssl>=0.13", - "PIL", + "Pillow>=2.3.0,<2.4", "lxml", "flask" ], From 1fa6bcbd5ab5e51f9e4250024c848933ea0911e7 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Sat, 4 Jan 2014 03:15:08 +0100 Subject: [PATCH 2/2] Update another reference to PIL. --- examples/upsidedownternet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/upsidedownternet.py b/examples/upsidedownternet.py index aaf8ff749..181a40c23 100644 --- a/examples/upsidedownternet.py +++ b/examples/upsidedownternet.py @@ -1,4 +1,6 @@ -import Image, cStringIO +import cStringIO +from PIL import Image + def response(context, flow): if flow.response.headers["content-type"] == ["image/png"]: s = cStringIO.StringIO(flow.response.content)