do not fail if user does not have pywin32

This commit is contained in:
Nikos Kouremenos 2005-11-02 10:52:12 +00:00
parent 3d5c3e59a1
commit 5e6766a3a4
1 changed files with 11 additions and 3 deletions

View File

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