Remove support for simplejson
On Python 3, simplejson has a different behaviour than the stdlib json, especially for dumping bytes. issue6010 review33601002
This commit is contained in:
1 parent
227da247f6
commit
f9c0457416
10 files changed
+8
-39
No files matched your search
@@ -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)
|
||||
|
||||
@@ -106,7 +106,6 @@ setup(name=name,
|
||||
'MySQL': ['MySQL-python'],
|
||||
'unoconv': ['unoconv'],
|
||||
'graphviz': ['pydot'],
|
||||
'simplejson': ['simplejson'],
|
||||
'cdecimal': ['cdecimal'],
|
||||
'Levenshtein': ['python-Levenshtein'],
|
||||
'BCrypt': ['bcrypt'],
|
||||
|
||||
+1
-4
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-4
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user