From 5577801aaab0ed7ccf30f818454278c1839513b2 Mon Sep 17 00:00:00 2001 From: Nicolas Pieuchot Date: Thu, 25 Apr 2013 21:45:12 +0200 Subject: [PATCH] Changing StringIO to BytesIO --- Tests/test_imagefont.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 11b26efb6..8305656e2 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -1,10 +1,7 @@ from tester import * from PIL import Image -try: - from io import StringIO # python 3 -except ImportError: - from StringIO import StringIO # python 2 +from io import BytesIO try: from PIL import ImageFont @@ -22,7 +19,7 @@ def test_font_with_name(): def test_font_with_filelike(): font_name = "Tests/fonts/FreeMono.ttf" - font_filelike = StringIO.StringIO(open(font_name, 'rb').read()) + font_filelike = BytesIO(open(font_name, 'rb').read()) font_size = 10 assert_no_exception(lambda: ImageFont.truetype(font_filelike, font_size))