diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index 43f21986ff3456973ed9513e53285fb3c9ee6e3d..1d91cb0e5d19846463bc984c97a4233631193b13 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -25,10 +25,15 @@ import pango import os import sys + +HAS_PYWIN32 = True if os.name == 'nt': - import win32file - import win32con - import pywintypes + try: + import win32file + import win32con + import pywintypes + except ImportError: + HAS_PYWIN32 = False from common import i18n i18n.init() @@ -356,6 +361,9 @@ def file_is_locked(path_to_file): if os.name != 'nt': # just in case return + if not HAS_PYWIN32: + return + secur_att = pywintypes.SECURITY_ATTRIBUTES() secur_att.Initialize()