summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services/eip/vpnprocess.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-04-09 16:24:12 -0500
committerKali Kaneko <kali@leap.se>2014-04-09 16:24:12 -0500
commitcf9fb29fd1098f694974ee60e5673f22e286d859 (patch)
tree5cdc4210b8c944ee4f2669fd8096998d507beda3 /src/leap/bitmask/services/eip/vpnprocess.py
parentf0232265a2725d8129b472479dd380b9ec3ca6b2 (diff)
parent81715dc47d77934c4f67d2527a56c28f58f0345d (diff)
Merge tag '0.5.0' into deb-0.5.0
Tag leap.bitmask version 0.5.0 Conflicts: pkg/requirements.pip
Diffstat (limited to 'src/leap/bitmask/services/eip/vpnprocess.py')
-rw-r--r--src/leap/bitmask/services/eip/vpnprocess.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py
index 51f0f738..5c100036 100644
--- a/src/leap/bitmask/services/eip/vpnprocess.py
+++ b/src/leap/bitmask/services/eip/vpnprocess.py
@@ -19,14 +19,20 @@ VPN Manager, spawned in a custom processProtocol.
"""
import logging
import os
-import psutil
-import psutil.error
import shutil
import socket
import sys
from itertools import chain, repeat
+import psutil
+try:
+ # psutil < 2.0.0
+ from psutil.error import AccessDenied as psutil_AccessDenied
+except ImportError:
+ # psutil >= 2.0.0
+ from psutil import AccessDenied as psutil_AccessDenied
+
from PySide import QtCore
from leap.bitmask.config.providerconfig import ProviderConfig
@@ -672,7 +678,7 @@ class VPNManager(object):
if any(map(lambda s: s.find("LEAPOPENVPN") != -1, p.cmdline)):
openvpn_process = p
break
- except psutil.error.AccessDenied:
+ except psutil_AccessDenied:
pass
return openvpn_process