From 79dec982945e784477d13f7dd5adff7ce96424f7 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Fri, 21 Oct 2016 16:58:33 -0400 Subject: [bug] fail gracefully for non-posix import --- src/leap/bitmask/bonafide/_protocol.py | 6 +++++- src/leap/bitmask/core/service.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask') 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 -- cgit v1.2.3