do not fail if user does not have pywin32
This commit is contained in:
parent
3d5c3e59a1
commit
5e6766a3a4
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue