Ignore warnings on windows when not in dev mode

This commit is contained in:
Philipp Hörist 2016-12-30 22:51:46 +01:00
parent 079b5346fe
commit 0443d5a69a
2 changed files with 2 additions and 4 deletions

View File

@ -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 = ''

View File

@ -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