1. clach04
  2. pysksync

Commits

clach04  committed 5a0c1af

srp module is optional, unless srp is requested.

  • Participants
  • Parent commits e306023
  • Branches srp

Comments (0)

Files changed (1)

File sksync.py

View file
     load_json = json.loads
 
 
-import srp
+def fake_module(name):
+    # Fail with a clear message (possibly at an unexpected time)
+    class MissingModule(object):
+        def __getattr__(self, attr):
+            raise ImportError('No module named %s' % name)
+
+        def __nonzero__(self):
+            return False
+
+    return MissingModule()
+
+try:
+    import srp
+except ImportError:
+    srp = fake_module('srp')
+
 
 
 # SK Sync specific constants