Explorar o código

Update ldtk_cjson.py

blueloveTH %!s(int64=2) %!d(string=hai) anos
pai
achega
4ae14022ed
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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