Ticket #8187: patch-8185-vs-r8255.diff

File patch-8185-vs-r8255.diff, 1.2 KB (added by sebastian.hillig, 16 years ago)

Replacing Image imports with from PIL import Image

  • tests/modeltests/model_forms/models.py

     
    7575        # Checking for the existence of Image is enough for CPython, but
    7676        # for PyPy, you need to check for the underlying modules
    7777        # If PIL is not available, this test is equivalent to TextFile above.
    78         import Image, _imaging
     78        from PIL import Image, _imaging
    7979        image = models.ImageField(storage=temp_storage, upload_to='tests')
    8080    except ImportError:
    8181        image = models.FileField(storage=temp_storage, upload_to='tests')
  • tests/regressiontests/file_storage/models.py

     
    1212try:
    1313    # Checking for the existence of Image is enough for CPython, but
    1414    # for PyPy, you need to check for the underlying modules
    15     import Image, _imaging
     15    from PIL import Image, _imaging
    1616except ImportError:
    1717    Image = None
    1818
Back to Top