~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/console.py

  • Committer: William Grant
  • Date: 2010-07-20 04:52:31 UTC
  • mto: This revision was merged to the branch mainline in revision 1826.
  • Revision ID: grantw@unimelb.edu.au-20100720045231-8ia3uk8nao8zdq1i
Replace cjson with json, or simplejson if json is not available (Python <2.6)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import StringIO
31
31
import uuid
32
32
 
33
 
import cjson
34
 
 
35
33
from ivle import chat, interpret
36
34
 
37
35
class ConsoleError(Exception):
190
188
            else:
191
189
                # Some other error - probably serious
192
190
                raise socket.error, (enumber, estring)
193
 
        except cjson.DecodeError:
 
191
        except ValueError:
194
192
            # Couldn't decode the JSON
195
193
            raise ConsoleError(
196
194
                "Could not understand the python console response")