summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-10-21 16:58:33 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-21 17:17:34 -0400
commit79dec982945e784477d13f7dd5adff7ce96424f7 (patch)
tree0b6a6a4346e40ed6089d55d8dab1efb464268083
parentb9f8766d72728093f6183c289d23ecd8a1fa562f (diff)
[bug] fail gracefully for non-posix import
-rw-r--r--src/leap/bitmask/bonafide/_protocol.py6
-rw-r--r--src/leap/bitmask/core/service.py5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/leap/bitmask/bonafide/_protocol.py b/src/leap/bitmask/bonafide/_protocol.py
index 047ad842..0afcd214 100644
--- a/src/leap/bitmask/bonafide/_protocol.py
+++ b/src/leap/bitmask/bonafide/_protocol.py
@@ -18,9 +18,13 @@
Bonafide protocol.
"""
import os
-import resource
from collections import defaultdict
+try:
+ import resource
+except ImportError:
+ pass
+
from leap.bitmask.bonafide import config
from leap.bitmask.bonafide.provider import Api
from leap.bitmask.bonafide.session import Session, OK
diff --git a/src/leap/bitmask/core/service.py b/src/leap/bitmask/core/service.py
index 5718178c..b6447ddd 100644
--- a/src/leap/bitmask/core/service.py
+++ b/src/leap/bitmask/core/service.py
@@ -18,7 +18,10 @@
Bitmask-core Service.
"""
import json
-import resource
+try:
+ import resource
+except ImportError:
+ pass
from twisted.internet import reactor
from twisted.logger import Logger