Py2 -> Py3: do not inherit classes from object

https://stackoverflow.com/questions/4015417/why-do-python-classes-inherit-object/45062077

Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
This commit is contained in:
Vadim Yanitskiy 2022-07-07 03:05:30 +07:00
parent bda52830c9
commit 04b5d9d7ab
5 changed files with 8 additions and 8 deletions

View File

@ -52,7 +52,7 @@ def format_addr(addr: str, addr_type: str) -> str:
return res
class SimCard(object):
class SimCard:
name = 'SIM'

View File

@ -27,7 +27,7 @@ from pySim.utils import rpad, b2h, h2b, sw_match, bertlv_encode_len, Hexstr, h2i
from pySim.exceptions import SwMatchError
class SimCardCommands(object):
class SimCardCommands:
def __init__(self, transport):
self._tp = transport
self.cla_byte = "a0"

View File

@ -49,7 +49,7 @@ from pySim.commands import SimCardCommands
# tuple: logical-and of the listed services requires this file
CardFileService = Union[int, List[int], Tuple[int, ...]]
class CardFile(object):
class CardFile:
"""Base class for all objects in the smart card filesystem.
Serve as a common ancestor to all other file types; rarely used directly.
"""
@ -1230,7 +1230,7 @@ class BerTlvEF(CardEF):
self.shell_commands = [self.ShellCommands()]
class RuntimeState(object):
class RuntimeState:
"""Represent the runtime state of a session with a card."""
def __init__(self, card, profile: 'CardProfile'):
@ -1648,7 +1648,7 @@ class RuntimeState(object):
cmd_app.unregister_command_set(c)
class FileData(object):
class FileData:
"""Represent the runtime, on-card data."""
def __init__(self, fdesc):
@ -1676,7 +1676,7 @@ def interpret_sw(sw_data: dict, sw: str):
return None
class CardApplication(object):
class CardApplication:
"""A card application is represented by an ADF (with contained hierarchy) and optionally
some SW definitions."""

View File

@ -62,7 +62,7 @@ def match_sim(scc: SimCardCommands) -> bool:
return _mf_select_test(scc, "a0", "0000")
class CardProfile(object):
class CardProfile:
"""A Card Profile describes a card, it's filesystem hierarchy, an [initial] list of
applications as well as profile-specific SW and shell commands. Every card has
one card profile, but there may be multiple applications within that profile."""

View File

@ -26,7 +26,7 @@ from pySim.exceptions import *
from pySim.utils import h2b, b2h
class L1CTLMessage(object):
class L1CTLMessage:
# Every (encoded) L1CTL message has the following structure:
# - msg_length (2 bytes, net order)