From 7bdc9cc044a1b57a47fcda7f4d548c01ad0680b7 Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Sun, 27 Dec 2015 21:56:57 +0800 Subject: [PATCH] [utils] Remove a redundant check in I18N --- youtube_dl/utils.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index a17db849b..333de7a64 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2539,14 +2539,13 @@ class I18N(object): if t is not None: return t - if t is None: - for root in get_root_dirs(): - try: - t = gettext.translation(self.domain, os.path.join(root, 'share', 'locale'), [lang]) - if t is not None: - break - except (OSError, IOError): # OSError for 3.3+ and IOError otherwise - t = None + for root in get_root_dirs(): + try: + t = gettext.translation(self.domain, os.path.join(root, 'share', 'locale'), [lang]) + if t is not None: + break + except (OSError, IOError): # OSError for 3.3+ and IOError otherwise + t = None if t is None and sys.platform == 'win32' and hasattr(sys, 'frozen'): locale_data_zip = _load_exe_resource('LOCALE_DATA', 'LOCALE_DATA.ZIP')