summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/leap/gui/mainwindow.py1
-rw-r--r--src/leap/platform_init/locks.py8
2 files changed, 3 insertions, 6 deletions
diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py
index ccf97672..358b7a41 100644
--- a/src/leap/gui/mainwindow.py
+++ b/src/leap/gui/mainwindow.py
@@ -38,6 +38,7 @@ from leap.services.eip.eipbootstrapper import EIPBootstrapper
from leap.services.eip.eipconfig import EIPConfig
from leap.services.eip.providerbootstrapper import ProviderBootstrapper
from leap.platform_init import IS_MAC, IS_WIN
+from leap.platform_init.locks import WindowsLock
from leap.platform_init.initializers import init_platform
from leap.services.eip.vpn import VPN
from leap.services.eip.vpnlaunchers import (VPNLauncherException,
diff --git a/src/leap/platform_init/locks.py b/src/leap/platform_init/locks.py
index e5b392a3..fefc209b 100644
--- a/src/leap/platform_init/locks.py
+++ b/src/leap/platform_init/locks.py
@@ -17,7 +17,6 @@
"""
Utilities for handling multi-platform file locking mechanisms
"""
-import commands
import logging
import errno
import os
@@ -30,10 +29,8 @@ from leap import platform_init
if platform_init.IS_UNIX:
from fcntl import flock, LOCK_EX, LOCK_NB
else:
- import errno
import glob
import shutil
- import socket
from tempfile import gettempdir
@@ -177,7 +174,7 @@ if platform_init.IS_WIN:
"""
try:
self._fd = os.makedirs(self.name)
- except WindowsError as exc:
+ except OSError as exc:
# could not create the dir
if exc.args[0] == 183:
logger.debug('cannot create dir')
@@ -218,8 +215,7 @@ if platform_init.IS_WIN:
try:
shutil.rmtree(self.name)
return True
-
- except WindowsError as exc:
+ except shutil.WindowsError as exc:
if exc.errno in (errno.EPIPE, errno.ENOENT,
errno.ESRCH, errno.EACCES):
logger.warning(