[GTKUI] Suppress unimportant gnome warnings

This commit is contained in:
Calum Lind 2014-08-09 00:10:20 +01:00
parent 9ba07d3883
commit 670cd21685

View File

@ -44,6 +44,7 @@ import os
import gtk
import sys
import logging
import warnings
log = logging.getLogger(__name__)
@ -165,7 +166,15 @@ class GtkUI(object):
try:
import gnome.ui
import gnome
self.gnome_prog = gnome.init("Deluge", deluge.common.get_version())
#Suppress: Warning: Attempt to add property GnomeProgram::*** after class was initialised
original_filters = warnings.filters[:]
warnings.simplefilter("ignore")
try:
self.gnome_prog = gnome.init("Deluge", deluge.common.get_version())
finally:
warnings.filters = original_filters
self.gnome_client = gnome.ui.master_client()
def on_die(*args):