[mulander] improve intl.dll search. Fixes #6006

This commit is contained in:
Yann Leboulanger 2010-10-27 09:41:04 +02:00
parent 2fa280acbb
commit ea48697543
1 changed files with 9 additions and 1 deletions

View File

@ -51,7 +51,15 @@ if os.name == 'nt':
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
import ctypes import ctypes
libintl = ctypes.cdll.LoadLibrary('gtk\\bin\\intl.dll') import ctypes.util
libintl_path = ctypes.util.find_library('intl')
if libintl_path == None:
local_intl = ok.path.join('gtk', 'bin', 'intl.dll')
if os.path.exists(local_intl):
libintl_path = local_intl
if libintl_path == None:
raise ImportError('intl.dll library not found')
libintl = ctypes.cdll.LoadLibrary(libintl_path)
libintl.bindtextdomain(APP, DIR) libintl.bindtextdomain(APP, DIR)
import warnings import warnings