summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Touceda <chiiph@leap.se>2013-05-10 12:09:02 -0300
committerkali <kali@leap.se>2013-05-11 21:59:59 +0900
commit9a1a657593c3ee18d35936a85077ae2f7e51c392 (patch)
treedef8c9c93955c1a7ef4ea946585d5095343a9ff1
parent4e201329042d43c8d281c5737d3d5f6f8e2bf67f (diff)
Fixup one instance on Windows
-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(