summaryrefslogtreecommitdiff
path: root/src/leap/bitmask
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-03-14 11:40:34 -0300
committerTomás Touceda <chiiph@leap.se>2014-03-14 11:40:34 -0300
commit036392269c30ca3468225d8aa4fc1540629071ec (patch)
tree8ad566a30efa22707a03caf2e75406d1af35a8fd /src/leap/bitmask
parentfa6ac24e679b0263efd2eb89ba53eeccd9ebb4d1 (diff)
parentdb31692ddf48abed1d02afc56eb33c8d7cd15234 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/bug/update-psutil-version' into develop
Diffstat (limited to 'src/leap/bitmask')
-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