mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-11 16:43:10 +03:00
easda
This commit is contained in:
parent
379b3922f1
commit
dfea906a80
|
@ -7,6 +7,9 @@ from unittest import mock
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from PIL import ImageTk
|
from PIL import ImageTk
|
||||||
|
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
|
||||||
from .helper import assert_image_equal, hopper
|
from .helper import assert_image_equal, hopper
|
||||||
|
|
||||||
TK_MODES = ("1", "L", "P", "RGB", "RGBA")
|
TK_MODES = ("1", "L", "P", "RGB", "RGBA")
|
||||||
|
@ -100,14 +103,3 @@ def test_bitmapimage() -> None:
|
||||||
# assert_image_equal(reloaded, im)
|
# assert_image_equal(reloaded, im)
|
||||||
|
|
||||||
|
|
||||||
def test_photoimage_del() -> None:
|
|
||||||
# Create a dummy PIL image
|
|
||||||
im = Image.new("RGB", (100, 100))
|
|
||||||
|
|
||||||
# Create a PhotoImage object
|
|
||||||
photo = ImageTk.PhotoImage(im)
|
|
||||||
|
|
||||||
# Delete the PhotoImage object
|
|
||||||
del photo
|
|
||||||
|
|
||||||
# No assertion needed, just ensuring that the __del__ method is executed
|
|
|
@ -20,7 +20,6 @@ def calculate_coverage(test_name):
|
||||||
"branches2": PdfParser.XrefTable.branches, # duru
|
"branches2": PdfParser.XrefTable.branches, # duru
|
||||||
"branches3": SpiderImagePlugin.branches, # isidora
|
"branches3": SpiderImagePlugin.branches, # isidora
|
||||||
"branches4": MpegImagePlugin.BitStream.branches, # isidora
|
"branches4": MpegImagePlugin.BitStream.branches, # isidora
|
||||||
"branches5": ImageTk.BitmapImage.branches, # deekshu
|
|
||||||
"branches6": ImageFile.PyEncoder.branches, # deekshu
|
"branches6": ImageFile.PyEncoder.branches, # deekshu
|
||||||
# Add more
|
# Add more
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,10 +31,6 @@ from io import BytesIO
|
||||||
|
|
||||||
from . import Image
|
from . import Image
|
||||||
|
|
||||||
branches = {
|
|
||||||
"1": False,
|
|
||||||
"2": False,
|
|
||||||
}
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Check for Tkinter interface hooks
|
# Check for Tkinter interface hooks
|
||||||
|
|
||||||
|
@ -192,10 +188,7 @@ class PhotoImage:
|
||||||
|
|
||||||
|
|
||||||
class BitmapImage:
|
class BitmapImage:
|
||||||
branches = {
|
|
||||||
"1": False,
|
|
||||||
"2": False,
|
|
||||||
}
|
|
||||||
"""
|
"""
|
||||||
A Tkinter-compatible bitmap image. This can be used everywhere Tkinter
|
A Tkinter-compatible bitmap image. This can be used everywhere Tkinter
|
||||||
expects an image object.
|
expects an image object.
|
||||||
|
@ -231,10 +224,8 @@ class BitmapImage:
|
||||||
name = self.__photo.name
|
name = self.__photo.name
|
||||||
self.__photo.name = None
|
self.__photo.name = None
|
||||||
try:
|
try:
|
||||||
BitmapImage.branches["1"] = True
|
|
||||||
self.__photo.tk.call("image", "delete", name)
|
self.__photo.tk.call("image", "delete", name)
|
||||||
except Exception:
|
except Exception:
|
||||||
BitmapImage.branches["2"] = True
|
|
||||||
pass # ignore internal errors
|
pass # ignore internal errors
|
||||||
|
|
||||||
def width(self) -> int:
|
def width(self) -> int:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user