Ticket #7131: simplejson-1.9.2.patch

File simplejson-1.9.2.patch, 2.1 KB (added by Matthew Flanagan <mattimustang@…>, 16 years ago)

patch simplejson-1.9.2 to turn it into django.utils.simplejson

  • simplejson/__init__.py

    diff -ur simplejson-1.9.2/simplejson/__init__.py simplejson/__init__.py
    old new  
    108108if __name__ == '__main__':
    109109    import warnings
    110110    warnings.warn('python -msimplejson is deprecated, use python -msiplejson.tool', DeprecationWarning)
    111     from simplejson.decoder import JSONDecoder
    112     from simplejson.encoder import JSONEncoder
     111    from django.utils.simplejson.decoder import JSONDecoder
     112    from django.utils.simplejson.encoder import JSONEncoder
    113113else:
    114114    from decoder import JSONDecoder
    115115    from encoder import JSONEncoder
  • simplejson/decoder.py

    Only in simplejson-1.9.2/simplejson: _speedups.so
    diff -ur simplejson-1.9.2/simplejson/decoder.py simplejson/decoder.py
    old new  
    44import re
    55import sys
    66
    7 from simplejson.scanner import Scanner, pattern
     7from django.utils.simplejson.scanner import Scanner, pattern
    88try:
    9     from simplejson._speedups import scanstring as c_scanstring
     9    from django.utils.simplejson._speedups import scanstring as c_scanstring
    1010except ImportError:
    1111    pass
    1212
  • simplejson/encoder.py

    diff -ur simplejson-1.9.2/simplejson/encoder.py simplejson/encoder.py
    old new  
    44import re
    55
    66try:
    7     from simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
     7    from django.utils.simplejson._speedups import encode_basestring_ascii as c_encode_basestring_ascii
    88except ImportError:
    99    pass
    1010
  • simplejson/tool.py

    diff -ur simplejson-1.9.2/simplejson/tool.py simplejson/tool.py
    old new  
    1212Note that the JSON produced by this module's default settings
    1313is a subset of YAML, so it may be used as a serializer for that as well.
    1414"""
    15 import simplejson
     15import django.utils.simplejson
    1616
    1717#
    1818# Pretty printer:
Back to Top