Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed unicode literals from PIL compat.

  • Loading branch information...
commit 4ecc6da20b00b2d00a8cc158056a10bf0a259d07 1 parent 33793f7
Florian Apolloner authored May 15, 2013

Showing 1 changed file with 7 additions and 5 deletions. Show diff stats Hide diff stats

  1. 12  django/utils/image.py
12  django/utils/image.py
@@ -67,6 +67,8 @@
67 67
             * ``ImportError`` - Bad install, toss an exception
68 68
 
69 69
 """
  70
+from __future__ import unicode_literals
  71
+
70 72
 import warnings
71 73
 
72 74
 from django.core.exceptions import ImproperlyConfigured
@@ -100,12 +102,12 @@ def _detect_image_library():
100 102
         except ImportError as err:
101 103
             # Neither worked, so it's likely not installed.
102 104
             raise ImproperlyConfigured(
103  
-                _(u"Neither Pillow nor PIL could be imported: %s" % err)
  105
+                _("Neither Pillow nor PIL could be imported: %s" % err)
104 106
             )
105 107
 
106 108
     # ``Image.alpha_composite`` was added to Pillow in SHA: e414c6 & is not
107 109
     # available in any version of the PIL.
108  
-    if hasattr(PILImage, u'alpha_composite'):
  110
+    if hasattr(PILImage, 'alpha_composite'):
109 111
         PIL_imaging = False
110 112
     else:
111 113
         # We're dealing with the PIL. Determine if we're on CPython & if
@@ -114,7 +116,7 @@ def _detect_image_library():
114 116
 
115 117
         # This is the Alex Approved™ way.
116 118
         # See http://mail.python.org/pipermail//pypy-dev/2011-November/008739.html
117  
-        if platform.python_implementation().lower() == u'cpython':
  119
+        if platform.python_implementation().lower() == 'cpython':
118 120
             # We're on CPython (likely 2.x). Since a C compiler is needed to
119 121
             # produce a fully-working PIL & will create a ``_imaging`` module,
120 122
             # we'll attempt to import it to verify their kit works.
@@ -122,8 +124,8 @@ def _detect_image_library():
122 124
                 import _imaging as PIL_imaging
123 125
             except ImportError as err:
124 126
                 raise ImproperlyConfigured(
125  
-                    _(u"The '_imaging' module for the PIL could not be " +
126  
-                      u"imported: %s" % err)
  127
+                    _("The '_imaging' module for the PIL could not be " +
  128
+                      "imported: %s" % err)
127 129
                 )
128 130
 
129 131
     # Try to import ImageFile as well.

0 notes on commit 4ecc6da

Please sign in to comment.
Something went wrong with that request. Please try again.