diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 05cd32654..4e1cff312 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -679,8 +679,7 @@ class Image(object): :returns: png version of the image as bytes """ - from io import BytesIO - b = BytesIO() + b = io.BytesIO() self.save(b, 'PNG') return b.getvalue()