diff --git a/src/application.py b/src/application.py index 9b3cb17c7..73fb826fc 100644 --- a/src/application.py +++ b/src/application.py @@ -20,7 +20,6 @@ import sys import os -import warnings import logging from gi.repository import GLib, Gio, Gtk from common import i18n @@ -126,9 +125,6 @@ class GajimApplication(Gtk.Application): # libintl.bindtextdomain('gajim_plugins', plugins_locale_dir) # libintl.bind_textdomain_codeset('gajim_plugins', 'UTF-8') - if os.name == 'nt': - warnings.filterwarnings(action='ignore') - if Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL: i18n.direction_mark = '\u200F' pritext = '' diff --git a/src/gajim.py b/src/gajim.py index 9b45f19d7..a627cb98a 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -48,6 +48,7 @@ if '--windev' in sys.argv or '-w' in sys.argv: WINDEV = True if os.name == 'nt' and not WINDEV: + import warnings log_path = os.path.join(os.environ['APPDATA'], 'Gajim') if not os.path.exists(log_path): os.mkdir(log_path, 0o700) @@ -77,6 +78,7 @@ if os.name == 'nt' and not WINDEV: outerr = MyStd() sys.stdout = outerr sys.stderr = outerr + warnings.filterwarnings(action='ignore') # Test here for all required versions so we dont have to