From 1606d9adf3b74719d4ffdf3c60410184c6767b65 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 22 Jun 2021 21:57:25 +1000 Subject: [PATCH] Removed code from before Python 3.2 --- src/PIL/ImagePalette.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/PIL/ImagePalette.py b/src/PIL/ImagePalette.py index 84dbeef02..236a44e37 100644 --- a/src/PIL/ImagePalette.py +++ b/src/PIL/ImagePalette.py @@ -90,9 +90,7 @@ class ImagePalette: if isinstance(self.palette, bytes): return self.palette arr = array.array("B", self.palette) - if hasattr(arr, "tobytes"): - return arr.tobytes() - return arr.tostring() + return arr.tobytes() # Declare tostring as an alias for tobytes tostring = tobytes