Removed unused variable from selftest

This commit is contained in:
Andrew Murray 2016-03-29 22:53:48 +11:00
parent 4d234fb54d
commit 0907f423ca

View File

@ -14,8 +14,6 @@ from PIL import features
if "--installed" in sys.argv: if "--installed" in sys.argv:
sys.path.insert(0, sys_path_0) sys.path.insert(0, sys_path_0)
ROOT = "."
try: try:
Image.core.ping Image.core.ping
except ImportError as v: except ImportError as v:
@ -50,13 +48,13 @@ def testimage():
Or open existing files: Or open existing files:
>>> im = Image.open(os.path.join(ROOT, "Tests/images/hopper.gif")) >>> im = Image.open("Tests/images/hopper.gif")
>>> _info(im) >>> _info(im)
('GIF', 'P', (128, 128)) ('GIF', 'P', (128, 128))
>>> _info(Image.open(os.path.join(ROOT, "Tests/images/hopper.ppm"))) >>> _info(Image.open("Tests/images/hopper.ppm"))
('PPM', 'RGB', (128, 128)) ('PPM', 'RGB', (128, 128))
>>> try: >>> try:
... _info(Image.open(os.path.join(ROOT, "Tests/images/hopper.jpg"))) ... _info(Image.open("Tests/images/hopper.jpg"))
... except IOError as v: ... except IOError as v:
... print(v) ... print(v)
('JPEG', 'RGB', (128, 128)) ('JPEG', 'RGB', (128, 128))
@ -64,7 +62,7 @@ def testimage():
PIL doesn't actually load the image data until it's needed, PIL doesn't actually load the image data until it's needed,
or you call the "load" method: or you call the "load" method:
>>> im = Image.open(os.path.join(ROOT, "Tests/images/hopper.ppm")) >>> im = Image.open("Tests/images/hopper.ppm")
>>> print(im.im) # internal image attribute >>> print(im.im) # internal image attribute
None None
>>> a = im.load() >>> a = im.load()
@ -74,7 +72,7 @@ def testimage():
You can apply many different operations on images. Most You can apply many different operations on images. Most
operations return a new image: operations return a new image:
>>> im = Image.open(os.path.join(ROOT, "Tests/images/hopper.ppm")) >>> im = Image.open("Tests/images/hopper.ppm")
>>> _info(im.convert("L")) >>> _info(im.convert("L"))
(None, 'L', (128, 128)) (None, 'L', (128, 128))
>>> _info(im.copy()) >>> _info(im.copy())