Merge lp:~cjwatson/launchpad/pil-image into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18646
Proposed branch: lp:~cjwatson/launchpad/pil-image
Merge into: lp:launchpad
Diff against target: 23 lines (+2/-2)
2 files modified
lib/lp/services/doc/sprites.txt (+1/-1)
lib/lp/services/spriteutils.py (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/pil-image
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+345391@code.launchpad.net

Commit message

Use "from PIL import Image" rather than "import Image".

The latter is deprecated, and no longer works in bionic.

Description of the change

We should probably move this into the virtualenv at some point rather than relying on a system dependency, but that'll require new -dev dependencies and is generally a bit more complicated than just chasing the module renaming.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/doc/sprites.txt'
2--- lib/lp/services/doc/sprites.txt 2015-03-19 16:44:53 +0000
3+++ lib/lp/services/doc/sprites.txt 2018-05-10 23:44:07 +0000
4@@ -48,7 +48,7 @@
5 in the file can be changed with the margin parameter.
6
7 >>> import os, tempfile
8- >>> import Image
9+ >>> from PIL import Image
10 >>> from lp.services.spriteutils import SpriteUtil
11 >>> root = os.path.abspath(os.path.join(__file__, '../../../../..'))
12 >>> icing = os.path.join(root, 'lib/canonical/launchpad/icing')
13
14=== modified file 'lib/lp/services/spriteutils.py'
15--- lib/lp/services/spriteutils.py 2012-06-02 03:14:47 +0000
16+++ lib/lp/services/spriteutils.py 2018-05-10 23:44:07 +0000
17@@ -18,7 +18,7 @@
18 from textwrap import dedent
19
20 import cssutils
21-import Image
22+from PIL import Image
23 import simplejson
24
25