Mercurial > skaapsteker
changeset 612:a91b2e4400a5
Fallback to using simplejson if json does not exist (this appears to be all that is needed to add Python2.5 compatibility).
author | Simon Cross <hodgestar@gmail.com> |
---|---|
date | Mon, 11 Apr 2011 23:54:56 +0200 |
parents | 7d49f698eff7 |
children | 303087bcf1fa |
files | skaapsteker/dialogue.py skaapsteker/gamestate.py skaapsteker/level.py |
diffstat | 3 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/skaapsteker/dialogue.py Mon Apr 11 08:57:24 2011 +0200 +++ b/skaapsteker/dialogue.py Mon Apr 11 23:54:56 2011 +0200 @@ -1,4 +1,7 @@ -import json +try: + import json +except ImportError: + import simplejson as json from . import data from .engine import OpenDialog, AddSpriteEvent, ChangeScene
--- a/skaapsteker/gamestate.py Mon Apr 11 08:57:24 2011 +0200 +++ b/skaapsteker/gamestate.py Mon Apr 11 23:54:56 2011 +0200 @@ -1,5 +1,9 @@ +try: + import json +except: + import simplejson as json + import os -import json from . import data from . import options
--- a/skaapsteker/level.py Mon Apr 11 08:57:24 2011 +0200 +++ b/skaapsteker/level.py Mon Apr 11 23:54:56 2011 +0200 @@ -1,4 +1,7 @@ -import json +try: + import json +except ImportError: + import simplejson as json from pygame import Rect, Surface, Color, mixer from pygame.sprite import LayeredUpdates