← Back to team overview

zim-wiki team mailing list archive

Re: Patch to avoid using "json" with python 2.5

 

On Tue, 12 Jan 2010, Raphael Hertzog wrote:
> Hello,
> 
> as reported in http://bugs.debian.org/564835, the "json" module exists for
> python 2.5 (as an external module, packaged in python-json) but it's an
> old version apparently that doesn't support some of the features that zim
> uses...
> 
> The user suggests a patch to not even try using "json" with python < 2.6
> and to go straight to simplejson in that case, it looks OK to me, see
> attachment. I enabled it on the debian package for now.

Here's the missing attachment.

Cheers,
-- 
Raphaël Hertzog
Description: don't use json module on python 2.5, fallback to simplejson
 It can only be an old version that lacks some of the features that zim
 requires.
Origin: other, http://bugs.debian.org/564835
Bug-Debian: http://bugs.debian.org/564835
Forwarded: yes, to the mailing list

--- a/zim/config.py.orig	2010-01-12 08:08:48.000000000 +0100
+++ b/zim/config.py	2010-01-12 08:08:44.000000000 +0100
@@ -14,6 +14,8 @@
 import logging
 
 try:
+        version_info = sys.version_info
+        assert version_info >= (2, 6)
 	import json # in standard lib since 2.6
 except:
 	import simplejson as json # extra dependency


Follow ups

References