Browse Source

Update ldtk_cjson.py

blueloveTH 2 years ago
parent
commit
4ae14022ed
1 changed files with 5 additions and 1 deletions
  1. 5 1
      benchmarks/ldtk_cjson.py

+ 5 - 1
benchmarks/ldtk_cjson.py

@@ -7,7 +7,11 @@ import sys
 is_pkpy = not hasattr(sys, 'getrefcount')
 is_pkpy = not hasattr(sys, 'getrefcount')
 
 
 if is_pkpy:
 if is_pkpy:
-    import cjson as json
+    try:
+        import cjson as json
+    except ImportError:
+        print('[cJSON not Enabled]')
+        exit(0)
 else:
 else:
     import json
     import json