diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -22,7 +22,11 @@ Created on April 21, 2010 changelog controller for pylons @author: marcink """ -from json import dumps +try: + import json +except ImportError: + #python 2.5 compatibility + import simplejson as json from mercurial.graphmod import colored, CHANGESET, revisions as graph_rev from pylons import request, session, tmpl_context as c from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator @@ -69,7 +73,7 @@ class ChangelogController(BaseController def _graph(self, repo, size, p): revcount = size - if not repo.revisions:return dumps([]), 0 + if not repo.revisions:return json.dumps([]), 0 max_rev = repo.revisions[-1] offset = 1 if p == 1 else ((p - 1) * revcount + 1) @@ -86,5 +90,5 @@ class ChangelogController(BaseController continue data.append(('', vtx, edges)) - c.jsdata = dumps(data) + c.jsdata = json.dumps(data) diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -35,7 +35,11 @@ from datetime import datetime, timedelta from time import mktime import calendar import logging -import json +try: + import json +except ImportError: + #python 2.5 compatibility + import simplejson as json log = logging.getLogger(__name__) class SummaryController(BaseController):