Changeset 8016
- Timestamp:
- 07/21/08 06:52:11 (5 months ago)
- Files:
-
- django/trunk/AUTHORS (modified) (1 diff)
- django/trunk/django/forms/fields.py (modified) (1 diff)
- django/trunk/tests/modeltests/model_forms/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/AUTHORS
r7967 r8016 151 151 Afonso Fernández Nogueira <fonzzo.django@gmail.com> 152 152 J. Pablo Fernandez <pupeno@pupeno.com> 153 Maciej Fijalkowski 153 154 Matthew Flanagan <http://wadofstuff.blogspot.com> 154 155 Eric Floehr <eric@intellovations.com> django/trunk/django/forms/fields.py
r7977 r8016 504 504 trial_image = Image.open(file) 505 505 trial_image.verify() 506 except ImportError: 507 # Under PyPy, it is possible to import PIL. However, the underlying 508 # _imaging C module isn't available, so an ImportError will be 509 # raised. Catch and re-raise. 510 raise 506 511 except Exception: # Python Imaging Library doesn't recognize it as an image 507 512 raise ValidationError(self.error_messages['invalid_image']) django/trunk/tests/modeltests/model_forms/models.py
r7998 r8016 70 70 try: 71 71 # If PIL is available, try testing PIL. 72 # Otherwise, it's equivalent to TextFile above. 73 import Image 72 # Checking for the existence of Image is enough for CPython, but 73 # for PyPy, you need to check for the underlying modules 74 # If PIL is not available, this test is equivalent to TextFile above. 75 import Image, _imaging 74 76 image = models.ImageField(upload_to=tempfile.gettempdir()) 75 77 except ImportError:
