diff --git a/doc/topics/install.rst b/doc/topics/install.rst index ba7c59a8fe..a449ead743 100644 --- a/doc/topics/install.rst +++ b/doc/topics/install.rst @@ -23,7 +23,6 @@ Prerequisites * Optional: pydot (http://code.google.com/p/pydot/) * Optional: unoconv http://dag.wieers.com/home-made/unoconv/) * Optional: sphinx (http://sphinx.pocoo.org/) - * Optional: simplejson (http://undefined.org/python/#simplejson) * Optional: cdecimal (http://www.bytereef.org/mpdecimal/index.html) * Optional: python-Levenshtein (http://github.com/miohtama/python-Levenshtein) diff --git a/setup.py b/setup.py index c512efdec8..65c09fd1e7 100644 --- a/setup.py +++ b/setup.py @@ -106,7 +106,6 @@ setup(name=name, 'MySQL': ['MySQL-python'], 'unoconv': ['unoconv'], 'graphviz': ['pydot'], - 'simplejson': ['simplejson'], 'cdecimal': ['cdecimal'], 'Levenshtein': ['python-Levenshtein'], 'BCrypt': ['bcrypt'], diff --git a/trytond/ir/model.py b/trytond/ir/model.py index 138ef24b74..f0498bfae3 100644 --- a/trytond/ir/model.py +++ b/trytond/ir/model.py @@ -2,16 +2,13 @@ # this repository contains the full copyright notices and license terms. import re import heapq +import json from sql import Null from sql.aggregate import Max from sql.conditionals import Case from collections import defaultdict from itertools import groupby -try: - import simplejson as json -except ImportError: - import json from ..model import (ModelView, ModelSQL, Workflow, fields, Unique, EvalEnvironment) diff --git a/trytond/ir/session.py b/trytond/ir/session.py index c1c8c789dd..80cd99ab09 100644 --- a/trytond/ir/session.py +++ b/trytond/ir/session.py @@ -1,9 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -try: - import simplejson as json -except ImportError: - import json +import json import uuid import datetime diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py index 33a4b7070b..395bca5ce3 100644 --- a/trytond/ir/ui/view.py +++ b/trytond/ir/ui/view.py @@ -3,10 +3,7 @@ import os import sys import logging -try: - import simplejson as json -except ImportError: - import json +import json from lxml import etree from trytond.model import ModelView, ModelSQL, fields diff --git a/trytond/model/dictschema.py b/trytond/model/dictschema.py index 34363a8d5f..38ed0f5feb 100644 --- a/trytond/model/dictschema.py +++ b/trytond/model/dictschema.py @@ -1,10 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the toplevel of this # repository contains the full copyright notices and license terms. +import json from collections import OrderedDict -try: - import simplejson as json -except ImportError: - import json from trytond.model import fields from trytond.pyson import Eval diff --git a/trytond/model/fields/dict.py b/trytond/model/fields/dict.py index be65ba2ec2..1f218078eb 100644 --- a/trytond/model/fields/dict.py +++ b/trytond/model/fields/dict.py @@ -1,9 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the toplevel of this # repository contains the full copyright notices and license terms. -try: - import simplejson as json -except ImportError: - import json +import json from sql import Query, Expression from .field import Field, SQLType diff --git a/trytond/protocols/jsonrpc.py b/trytond/protocols/jsonrpc.py index b91fa2cd49..659814290f 100644 --- a/trytond/protocols/jsonrpc.py +++ b/trytond/protocols/jsonrpc.py @@ -2,10 +2,7 @@ # this repository contains the full copyright notices and license terms. import datetime from decimal import Decimal -try: - import simplejson as json -except ImportError: - import json +import json import base64 from werkzeug.wrappers import Response @@ -53,11 +50,6 @@ class JSONEncoder(json.JSONEncoder): serializers = {} - def __init__(self, *args, **kwargs): - super(JSONEncoder, self).__init__(*args, **kwargs) - # Force to use our custom decimal with simplejson - self.use_decimal = False - @classmethod def register(cls, klass, encoder): assert klass not in cls.serializers diff --git a/trytond/pyson.py b/trytond/pyson.py index 23137c06ca..6620c84420 100644 --- a/trytond/pyson.py +++ b/trytond/pyson.py @@ -1,9 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -try: - import simplejson as json -except ImportError: - import json +import json import datetime from dateutil.relativedelta import relativedelta from functools import reduce, wraps diff --git a/trytond/wizard/wizard.py b/trytond/wizard/wizard.py index fc8f430e2a..f1d2abed1c 100644 --- a/trytond/wizard/wizard.py +++ b/trytond/wizard/wizard.py @@ -5,10 +5,7 @@ __all__ = ['Wizard', 'StateView', 'StateTransition', 'StateAction', 'StateReport', 'Button'] -try: - import simplejson as json -except ImportError: - import json +import json import copy from trytond.pool import Pool, PoolBase