summaryrefslogtreecommitdiff
path: root/src/leap/platform_init/locks.py
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 /src/leap/platform_init/locks.py
parent4e201329042d43c8d281c5737d3d5f6f8e2bf67f (diff)
Fixup one instance on Windows
Diffstat (limited to 'src/leap/platform_init/locks.py')
-rw-r--r--src/leap/platform_init/locks.py8
1 files changed, 2 insertions, 6 deletions
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(