From 2a5a184662cddab7f23448e4b4d366a277739ff7 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 3 Sep 2018 10:00:23 -0500 Subject: [PATCH] Stopped using deprecated objects when Loading images due to WX 4 --- src/controller/posts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controller/posts.py b/src/controller/posts.py index 13cac86..f4dd0db 100644 --- a/src/controller/posts.py +++ b/src/controller/posts.py @@ -185,10 +185,10 @@ class postController(object): url = self.get_photo_url(self.images[index]["photo"], "x") if url != "": img = requests.get(url) - image = wx.ImageFromStream(cStringIO.StringIO(requests.get(url).content)) + image = wx.Image(stream=cStringIO.StringIO(requests.get(url).content)) try: - self.dialog.image.SetBitmap(wx.BitmapFromImage(image)) - except: + self.dialog.image.SetBitmap(wx.Bitmap(image)) + except NameError: return self.dialog.SetClientSize(self.dialog.sizer.CalcMin()) # Translators: {0} is the number of the current photo and {1} is the total number of photos.