Skip to content

Commit

Permalink
We know we have json in Python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusty Phillips committed Jan 24, 2010
1 parent 1975913 commit 06224e7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions psyclone/escape.py
Expand Up @@ -19,12 +19,9 @@
import html.entities
import re
import xml.sax.saxutils
import urllib.request, urllib.parse, urllib.error
from .byte_utils import force_str

import json
_json_decode = lambda s: json.loads(s)
_json_encode = lambda v: json.dumps(v)
import urllib.parse
from .byte_utils import force_str


def xhtml_escape(value):
Expand All @@ -39,12 +36,12 @@ def xhtml_unescape(value):

def json_encode(value):
"""JSON-encodes the given Python object."""
return _json_encode(value)
return json.dumps(value)


def json_decode(value):
"""Returns Python objects for the given JSON string."""
return _json_decode(value)
return json.loads(value)


def squeeze(value):
Expand Down

0 comments on commit 06224e7

Please sign in to comment.