From 9a1a657593c3ee18d35936a85077ae2f7e51c392 Mon Sep 17 00:00:00 2001 From: Tomas Touceda Date: Fri, 10 May 2013 12:09:02 -0300 Subject: Fixup one instance on Windows --- src/leap/gui/mainwindow.py | 1 + src/leap/platform_init/locks.py | 8 ++------ 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( -- cgit v1.2.3