From 0cf6f80b517bc0e7f0539cd21516fcb7118e2220 Mon Sep 17 00:00:00 2001 From: Josh Marshall Date: Tue, 30 Mar 2021 12:32:11 +0900 Subject: Removing Python 2 fallbacks, tweaking test runners, fixing flake8 errors. --- jsonrpclib/jsonclass.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'jsonrpclib/jsonclass.py') diff --git a/jsonrpclib/jsonclass.py b/jsonrpclib/jsonclass.py index 31f829d..17e3653 100644 --- a/jsonrpclib/jsonclass.py +++ b/jsonrpclib/jsonclass.py @@ -5,12 +5,8 @@ from jsonrpclib import config iter_types = (dict, list, tuple) value_types = (bool, ) -try: - string_types = (basestring, ) # Python 2.7 - numeric_types = (int, long, float) -except NameError: - string_types = (str, ) # Python 3.x - numeric_types = (int, float) +string_types = (str, ) +numeric_types = (int, float) supported_types = iter_types+string_types+numeric_types+value_types invalid_module_chars = r'[^a-zA-Z0-9\_\.]' @@ -77,7 +73,8 @@ def dump(obj, serialize_method=None, ignore_attribute=None, ignore=[]): def load(obj): - if obj is None or isinstance(obj, string_types + numeric_types + value_types): + if obj is None or isinstance( + obj, string_types + numeric_types + value_types): return obj if isinstance(obj, list): -- cgit v1.2.1