File: 05_fix-pil-import.patch

package info (click to toggle)
circuits 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,384 kB
  • ctags: 3,037
  • sloc: python: 14,416; makefile: 146; sh: 61
file content (21 lines) | stat: -rw-r--r-- 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: Fix PIL import
 see http://lists.debian.org/debian-python/2013/02/msg00017.html for details.
Author: Daniele Tricoli <eriol@mornie.org>
Last-Update: 2013-07-09

--- a/circuits/web/apps/memorymonitor/__init__.py
+++ b/circuits/web/apps/memorymonitor/__init__.py
@@ -6,8 +6,11 @@
 import threading
 from types import FrameType, ModuleType
 
-import Image
-import ImageDraw
+try:
+    from PIL import Image, ImageDraw
+except ImportError:
+    import Image
+    import ImageDraw
 
 from circuits import handler
 from circuits.web import Controller