Skip to content

Commit 0bf2f51

Browse files
author
taher
committed
Fixes issue with Python 2.5. Credit goes for Jedrzej Nowak
git-svn-id: svn://cherokee-project.com/CTK/trunk@4887 5dc97367-97f1-0310-9951-d761b3857238
1 parent ce51f22 commit 0bf2f51

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CTK/Server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222

2323
import re
2424
import sys
25-
import json
2625
import types
2726
import threading
2827
import traceback
28+
try:
29+
import json
30+
except ImportError:
31+
import simplejson as json
2932

3033
import pyscgi
3134
import Cookie

CTK/Widget.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ def toJSON (self):
7474
else:
7575
help = []
7676

77-
import json
77+
try:
78+
import json
79+
except ImportError:
80+
import simplejson as json
7881
return json.dumps({'html': self.html,
7982
'js': Postprocess(self.js),
8083
'headers': self.headers,

0 commit comments

Comments
 (0)