diff --git a/cbor/cbor_rpc_client.py b/cbor/cbor_rpc_client.py index e801456..07f0fbe 100644 --- a/cbor/cbor_rpc_client.py +++ b/cbor/cbor_rpc_client.py @@ -91,7 +91,7 @@ def close(self): self._socket.shutdown(socket.SHUT_RDWR) self._socket.close() except socket.error: - logger.warn('error closing lockd client socket', + logger.warning('error closing lockd client socket', exc_info=True) self._socket = None @@ -172,4 +172,4 @@ def _rpc(self, method_name, params): #print(client._rpc(u'ping', [])) #print(client._rpc(u'gnip', [])) client.close() - + diff --git a/cbor/tests/test_cbor.py b/cbor/tests/test_cbor.py index a3bf3ca..14ddf69 100644 --- a/cbor/tests/test_cbor.py +++ b/cbor/tests/test_cbor.py @@ -27,7 +27,7 @@ from cbor._cbor import load as cload except ImportError: # still test what we can without C fast mode - logger.warn('testing without C accelerated CBOR', exc_info=True) + logger.warning('testing without C accelerated CBOR', exc_info=True) cdumps, cloads, cdump, cload = None, None, None, None @@ -62,7 +62,7 @@ def dump(cls, *args, **kwargs): def testable(cls): ok = (cls._ld[0] is not None) and (cls._ld[1] is not None) and (cls._ld[3] is not None) and (cls._ld[4] is not None) if not ok: - logger.warn('non-testable case %s skipped', cls.__name__) + logger.warning('non-testable case %s skipped', cls.__name__) return ok # Can't set class level function pointers, because then they expect a @@ -281,6 +281,10 @@ def test_sortkeys(self): xbytes = [] for n in _range(2, 27): ob = {u'{:02x}'.format(x):x for x in _range(n)} + # ensure some "ob" have unsorted key:value entries + if n in [4, 6, 9]: + ob.pop('01') + ob["01"] = 1 obytes.append(self.dumps(ob, sort_keys=True)) xbytes.append(self.dumps(ob, sort_keys=False)) allOGood = True diff --git a/cbor/tests/test_usage.py b/cbor/tests/test_usage.py index d72f2e8..9d7e6a1 100644 --- a/cbor/tests/test_usage.py +++ b/cbor/tests/test_usage.py @@ -22,7 +22,7 @@ from cbor._cbor import load as cload except ImportError: # still test what we can without C fast mode - logger.warn('testing without C accelerated CBOR', exc_info=True) + logger.warning('testing without C accelerated CBOR', exc_info=True) cdumps, cloads, cdump, cload = None, None, None, None @@ -48,7 +48,7 @@ def test_dumps_usage(self): repeatedly serialize, check that usage doesn't go up ''' if cdumps is None: - logger.warn('no C dumps(), skipping test_dumps_usage') + logger.warning('no C dumps(), skipping test_dumps_usage') return start_usage = resource.getrusage(resource.RUSAGE_SELF) usage_history = [start_usage] @@ -76,7 +76,7 @@ def test_loads_usage(self): repeatedly serialize, check that usage doesn't go up ''' if (cdumps is None) or (cloads is None): - logger.warn('no C fast CBOR, skipping test_loads_usage') + logger.warning('no C fast CBOR, skipping test_loads_usage') return ## Just a string passes! #ob = 'sntaoheusnatoheusnaotehuasnoetuhaosentuhaoesnth' @@ -113,7 +113,7 @@ def test_tempfile(self): it, checking usage all along the way. ''' if cdump is None: - logger.warn('no C dump(), skipping test_tempfile') + logger.warning('no C dump(), skipping test_tempfile') return with tempfile.NamedTemporaryFile() as ntf: # first, write a bunch to temp file @@ -168,7 +168,7 @@ def test_tempfile(self): def test_stringio_usage(self): '''serialize data to StringIO, read it back''' if cdump is None: - logger.warn('no C dump(), skipping test_tempfile') + logger.warning('no C dump(), skipping test_tempfile') return # warmup the rusage, allocate everything! diff --git a/cbor/tests/test_vectors.py b/cbor/tests/test_vectors.py index f4d8ca9..afed311 100644 --- a/cbor/tests/test_vectors.py +++ b/cbor/tests/test_vectors.py @@ -27,7 +27,7 @@ from cbor._cbor import loads as cloads except ImportError: # still test what we can without C fast mode - logger.warn('testing without C accelerated CBOR', exc_info=True) + logger.warning('testing without C accelerated CBOR', exc_info=True) #cdumps, cloads = None, None cloads = None from cbor import Tag diff --git a/setup.py b/setup.py index 93fc7ee..e16ad38 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,12 @@ #! /usr/bin/env python # Copyright 2014 Brian Olson -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -75,7 +75,7 @@ def build_extension(self, ext): author='Brian Olson', author_email='bolson@bolson.org', url='https://github.com/brianolson/cbor_py', - packages=['cbor'], + packages=['cbor', 'cbor/tests'], package_dir={'cbor':'cbor'}, ext_modules=[ Extension( @@ -94,6 +94,9 @@ def build_extension(self, ext): 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: C', 'Topic :: Software Development :: Libraries :: Python Modules', ],