My module currently imports the json
module, which is only available in 2.6. I'd like to make a check against the python version to import simplejson
, which can be built for 2.5 (and is the module adopted in 2.6 anyway). Something like:
if __version__ 2.5:
import simplejson as json
else:
import json
What's the best way to approach this?