Skip to content

Commit

Permalink
Remove inheritance from object class
Browse files Browse the repository at this point in the history
This was needed for 2.7 compatibility, which we have now removed.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Jun 7, 2024
1 parent 5046338 commit ce4f467
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ijson/backends/yajl2_cffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def yajl_parse(handle, buffer):
raise exception(error)


class Container(object):
class Container:
pass


Expand Down
4 changes: 2 additions & 2 deletions ijson/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _stdout_tty_write_flush(message):
stdout.flush()


class progress_message(object):
class progress_message:

def __init__(self, message):
self.message = message
Expand All @@ -111,7 +111,7 @@ def __exit__(self, *args):
_stdout_tty_write_flush('\r\033[K')


class AsyncReader(object):
class AsyncReader:
def __init__(self, data):
self.data = io.BytesIO(data)

Expand Down
2 changes: 1 addition & 1 deletion ijson/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def parse_basecoro(target):
target.send((prefix, event, value))


class ObjectBuilder(object):
class ObjectBuilder:
'''
Incrementally builds an object from JSON parser events. Events are passed
into the `event` function that accepts two parameters: event type and
Expand Down
2 changes: 1 addition & 1 deletion ijson/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import warnings


class utf8reader(object):
class utf8reader:
"""Takes a utf8-encoded string reader and reads bytes out of it"""

def __init__(self, str_reader):
Expand Down
2 changes: 1 addition & 1 deletion ijson/utils35.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class sendable_deque(collections.deque):
'''Like utils.sendable_list, but for deque objects'''
send = collections.deque.append

class async_iterable(object):
class async_iterable:
'''
A utility class that implements an async iterator returning values
dispatched by a coroutine pipeline after *it* has received values coming
Expand Down
2 changes: 1 addition & 1 deletion tests/_test_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ._test_async_common import _get_all, _get_first


class AsyncReader(object):
class AsyncReader:
def __init__(self, data):
if type(data) == bytes:
self.data = io.BytesIO(data)
Expand Down
2 changes: 1 addition & 1 deletion tests/_test_async_types_coroutine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from ._test_async_common import _get_all, _get_first

class AsyncReaderTypesCoroutine(object):
class AsyncReaderTypesCoroutine:
def __init__(self, data):
if type(data) == bytes:
self.data = io.BytesIO(data)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
}


class warning_catcher(object):
class warning_catcher:
'''Encapsulates proper warning catch-all logic in python 2.7 and 3'''

def __init__(self):
Expand All @@ -329,7 +329,7 @@ def __exit__(self, *args):
self.catcher.__exit__(*args)


class BackendSpecificTestCase(object):
class BackendSpecificTestCase:
'''
Base class for backend-specific tests, gives ability to easily and
generically reference different methods on the backend. It requires
Expand All @@ -341,7 +341,7 @@ def __getattr__(self, name):
return getattr(self.backend, name + self.method_suffix)


class IJsonTestsBase(object):
class IJsonTestsBase:
'''
Base class with common tests for all iteration methods.
Subclasses implement `all()` and `first()` to collect events coming from
Expand Down Expand Up @@ -572,7 +572,7 @@ def test_top_level_embedded_empty_member(self):
self._test_empty_member(EMPTY_MEMBER_TEST_CASES['top_level_embedded'])


class FileBasedTests(object):
class FileBasedTests:

def test_string_stream(self):
with warning_catcher() as warns:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@



class SingleReadFile(object):
class SingleReadFile:
'''A bytes file that can be read only once'''

def __init__(self, raw_value):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_yajl2_c_loadable(self):
importlib.util.module_from_spec(spec)


class MainEntryPoints(object):
class MainEntryPoints:

def _assert_invalid_type(self, routine, *args, **kwargs):
# Functions are not valid inputs
Expand Down

0 comments on commit ce4f467

Please sign in to comment.