mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 07:57:27 +03:00 
			
		
		
		
	Merge pull request #2927 from radarhere/imports
Removed unused and duplicate imports
This commit is contained in:
		
						commit
						137ef0454c
					
				|  | @ -475,8 +475,6 @@ class TestFileGif(PillowTestCase): | ||||||
|         # that's > 128 items where the transparent color is actually |         # that's > 128 items where the transparent color is actually | ||||||
|         # the top palette entry to trigger the bug. |         # the top palette entry to trigger the bug. | ||||||
| 
 | 
 | ||||||
|         from PIL import ImagePalette |  | ||||||
| 
 |  | ||||||
|         data = bytes(bytearray(range(1, 254))) |         data = bytes(bytearray(range(1, 254))) | ||||||
|         palette = ImagePalette.ImagePalette("RGB", list(range(256))*3) |         palette = ImagePalette.ImagePalette("RGB", list(range(256))*3) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -576,7 +576,6 @@ class TestFileCloseW32(PillowTestCase): | ||||||
| 
 | 
 | ||||||
|     def test_fd_leak(self): |     def test_fd_leak(self): | ||||||
|         tmpfile = self.tempfile("temp.jpg") |         tmpfile = self.tempfile("temp.jpg") | ||||||
|         import os |  | ||||||
| 
 | 
 | ||||||
|         with Image.open("Tests/images/hopper.jpg") as im: |         with Image.open("Tests/images/hopper.jpg") as im: | ||||||
|             im.save(tmpfile) |             im.save(tmpfile) | ||||||
|  |  | ||||||
|  | @ -388,7 +388,6 @@ class TestFileTiff(PillowTestCase): | ||||||
|                   'y_resolution': 36} |                   'y_resolution': 36} | ||||||
|         filename = self.tempfile("temp.tif") |         filename = self.tempfile("temp.tif") | ||||||
|         hopper("RGB").save(filename, **kwargs) |         hopper("RGB").save(filename, **kwargs) | ||||||
|         from PIL.TiffImagePlugin import X_RESOLUTION, Y_RESOLUTION |  | ||||||
|         im = Image.open(filename) |         im = Image.open(filename) | ||||||
| 
 | 
 | ||||||
|         # legacy interface |         # legacy interface | ||||||
|  |  | ||||||
|  | @ -258,7 +258,6 @@ class TestEmbeddable(unittest.TestCase): | ||||||
|     def test_embeddable(self): |     def test_embeddable(self): | ||||||
|         import subprocess |         import subprocess | ||||||
|         import ctypes |         import ctypes | ||||||
|         import setuptools |  | ||||||
|         from distutils import ccompiler, sysconfig |         from distutils import ccompiler, sysconfig | ||||||
| 
 | 
 | ||||||
|         with open('embed_pil.c', 'w') as fh: |         with open('embed_pil.c', 'w') as fh: | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import sys | import sys | ||||||
| 
 | 
 | ||||||
| from helper import unittest, PillowTestCase, py3 | from helper import unittest, PillowTestCase | ||||||
| 
 | 
 | ||||||
| from PIL import Image | from PIL import Image | ||||||
| 
 | 
 | ||||||
|  | @ -223,7 +223,7 @@ class TestLibUnpack(PillowTestCase): | ||||||
|         self.assert_unpack("L", "L;R", 1, 128, 64, 192, 32) |         self.assert_unpack("L", "L;R", 1, 128, 64, 192, 32) | ||||||
|         self.assert_unpack("L", "L;16", 2, 2, 4, 6, 8) |         self.assert_unpack("L", "L;16", 2, 2, 4, 6, 8) | ||||||
|         self.assert_unpack("L", "L;16B", 2, 1, 3, 5, 7) |         self.assert_unpack("L", "L;16B", 2, 1, 3, 5, 7) | ||||||
|         self.assert_unpack("L", "L;16", b'\x00\xc6\x00\xaf', 198, 175)  |         self.assert_unpack("L", "L;16", b'\x00\xc6\x00\xaf', 198, 175) | ||||||
|         self.assert_unpack("L", "L;16B", b'\xc6\x00\xaf\x00', 198, 175) |         self.assert_unpack("L", "L;16B", b'\xc6\x00\xaf\x00', 198, 175) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,5 @@ | ||||||
| from helper import unittest, PillowTestCase, hopper | from helper import unittest, PillowTestCase, hopper | ||||||
| 
 | 
 | ||||||
| from PIL import Image |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| class TestUploader(PillowTestCase): | class TestUploader(PillowTestCase): | ||||||
|     def check_upload_equal(self): |     def check_upload_equal(self): | ||||||
|  |  | ||||||
|  | @ -23,10 +23,9 @@ | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| from . import Image, ImageFile | from . import Image, ImageFile | ||||||
| from ._binary import i8, o8, i16be as i16, o16be as o16 | from ._binary import i8, o8, i16be as i16 | ||||||
| import struct | import struct | ||||||
| import os | import os | ||||||
| import sys |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| __version__ = "0.3" | __version__ = "0.3" | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user