8000 Clean up calls to Gtk.Window.set_icon_from_file. · matplotlib/matplotlib@3cc49ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 3cc49ee

Browse files
committed
Clean up calls to Gtk.Window.set_icon_from_file.
According to the docs, this function was added in GTK 2.2, so probably was only needed when we supported GTK2. It also no longer exists in GTK4.
1 parent 6b571e9 commit 3cc49ee

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,7 @@ def __init__(self, canvas, num):
300300
super().__init__(canvas, num)
301301

302302
self.window.set_wmclass("matplotlib", "Matplotlib")
303-
try:
304-
self.window.set_icon_from_file(window_icon)
305-
except Exception:
306-
# Some versions of gtk throw a glib.GError but not all, so I am not
307-
# sure how to catch it. I am unhappy doing a blanket catch here,
308-
# but am not sure what a better way is - JDH
309-
_log.info('Could not load matplotlib icon: %s', sys.exc_info()[1])
303+
self.window.set_icon_from_file(window_icon)
310304

311305
self.vbox = Gtk.Box()
312306
self.vbox.set_property("orientation", Gtk.Orientation.VERTICAL)

lib/matplotlib/backends/backend_gtk4.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,6 @@ def __init__(self, canvas, num):
264264
app.add_window(self.window)
265265
super().__init__(canvas, num)
266266

267-
try:
268-
self.window.set_icon_from_file(window_icon)
269-
except Exception:
270-
# Some versions of gtk throw a glib.GError but not all, so I am not
271-
# sure how to catch it. I am unhappy doing a blanket catch here,
272-
# but am not sure what a better way is - JDH
273-
_log.info('Could not load matplotlib icon: %s', sys.exc_info()[1])
274-
275267
self.vbox = Gtk.Box()
276268
self.vbox.set_property("orientation", Gtk.Orientation.VERTICAL)
277269
self.window.set_child(self.vbox)

0 commit comments

Comments
 (0)
0