[Image-SIG] Minitest failure: expected None, got Nonetype

Fredrik Lundh fredrik@pythonware.com
Thu, 12 Sep 2002 11:25:20 +0200


stani wrote:


> After succesfully installing PIL on red hat linux 7.3
> for python2.2  I got following failure trying out the
> MiniTest:
> 
> > Failure in example: type(im.im) # internal image
> attribute
> > from line #31 of test.testimage
> > Expected: <type 'None'>
> > Got: <type 'NoneType'>
> > 1 items had failures:
> >    1 of  40 in test.testimage
> > ***Test Failed*** 1 failures.
> > *** 1 tests of 40 failed.
> 
> Does anybody know why there is this difference between
> these two types?  Is this an error?

the representation of the None type was changed in Python 2.2,
which broke the test script.

to fix this, you can replace the "load" section in MiniTest/test.py
with:

    >>> im = Image.open("Images/lena.ppm")
    >>> print im.im # internal image attribute
    None
    >>> im.load()
    >>> type(im.im)
    <type 'ImagingCore'>

</F>