From 953757a3e37ffb80570a20a8eca52dae35fc27bb Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Sat, 26 Oct 2019 10:40:44 +0100 Subject: [PATCH] CLN: remove simplejson (#29169) --- pandas/io/msgpack/__init__.py | 2 +- pandas/io/msgpack/_packer.pyx | 1 - pandas/io/msgpack/_unpacker.pyx | 3 +-- pandas/util/_print_versions.py | 6 +----- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pandas/io/msgpack/__init__.py b/pandas/io/msgpack/__init__.py index 7107263c180cb..11407c8282660 100644 --- a/pandas/io/msgpack/__init__.py +++ b/pandas/io/msgpack/__init__.py @@ -48,7 +48,7 @@ def packb(o, **kwargs): return Packer(**kwargs).pack(o) -# alias for compatibility to simplejson/marshal/pickle. +# alias for compatibility to json/marshal/pickle. load = unpack loads = unpackb diff --git a/pandas/io/msgpack/_packer.pyx b/pandas/io/msgpack/_packer.pyx index 19307e2334f1e..aa71c5cc39667 100644 --- a/pandas/io/msgpack/_packer.pyx +++ b/pandas/io/msgpack/_packer.pyx @@ -60,7 +60,6 @@ cdef class Packer: :param callable default: Convert user type to builtin type that Packer supports. - See also simplejson's document. :param str encoding: Convert unicode to bytes with this encoding. (default: 'utf-8') :param str unicode_errors: diff --git a/pandas/io/msgpack/_unpacker.pyx b/pandas/io/msgpack/_unpacker.pyx index d7ebb194ef5c5..cf9b2c7c04d42 100644 --- a/pandas/io/msgpack/_unpacker.pyx +++ b/pandas/io/msgpack/_unpacker.pyx @@ -200,11 +200,10 @@ cdef class Unpacker: :param callable object_hook: When specified, it should be callable. Unpacker calls it with a dict argument after unpacking msgpack map. - (See also simplejson) :param callable object_pairs_hook: When specified, it should be callable. Unpacker calls it with a list - of key-value pairs after unpacking msgpack map. (See also simplejson) + of key-value pairs after unpacking msgpack map. :param str encoding: Encoding used for decoding msgpack raw. diff --git a/pandas/util/_print_versions.py b/pandas/util/_print_versions.py index 25795859d8018..289a32c51a916 100644 --- a/pandas/util/_print_versions.py +++ b/pandas/util/_print_versions.py @@ -1,4 +1,5 @@ import codecs +import json import locale import os import platform @@ -105,11 +106,6 @@ def show_versions(as_json=False): deps_blob.append((modname, ver)) if as_json: - try: - import json - except ImportError: - import simplejson as json - j = dict(system=dict(sys_info), dependencies=dict(deps_blob)) if as_json is True: