Change in pysim[master]: Py2 -> Py3: do not inherit classes from object

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Mon Apr 5 17:14:57 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/23633 )


Change subject: Py2 -> Py3: do not inherit classes from object
......................................................................

Py2 -> Py3: do not inherit classes from object

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

Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
---
M pySim/card_data.py
M pySim/cards.py
M pySim/commands.py
M pySim/filesystem.py
M pySim/transport/__init__.py
M pySim/transport/calypso.py
6 files changed, 10 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/33/23633/1

diff --git a/pySim/card_data.py b/pySim/card_data.py
index ebc63a6..6c162e8 100644
--- a/pySim/card_data.py
+++ b/pySim/card_data.py
@@ -24,7 +24,7 @@
 
 card_data_provider = []
 
-class CardData(object):
+class CardData:
 
 	VALID_FIELD_NAMES = ['ICCID', 'ADM1', 'IMSI', 'PIN1', 'PIN2', 'PUK1', 'PUK2']
 
diff --git a/pySim/cards.py b/pySim/cards.py
index 5eb2884..a9ad7ff 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -29,7 +29,7 @@
 from smartcard.util import toBytes
 from pytlv.TLV import *
 
-class Card(object):
+class Card:
 
 	def __init__(self, scc):
 		self._scc = scc
diff --git a/pySim/commands.py b/pySim/commands.py
index 7919099..5f60280 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -24,7 +24,7 @@
 from pySim.utils import rpad, b2h, sw_match
 from pySim.exceptions import SwMatchError
 
-class SimCardCommands(object):
+class SimCardCommands:
 	def __init__(self, transport):
 		self._tp = transport
 		self._cla_byte = "a0"
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 3eea2f4..8324ab1 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -36,7 +36,7 @@
 from pySim.utils import sw_match, h2b, b2h, is_hex
 from pySim.exceptions import *
 
-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.
     """
@@ -799,7 +799,7 @@
 
 
 
-class RuntimeState(object):
+class RuntimeState:
     """Represent the runtime state of a session with a card."""
     def __init__(self, card, profile:'CardProfile'):
         """
@@ -1050,7 +1050,7 @@
 
 
 
-class FileData(object):
+class FileData:
     """Represent the runtime, on-card data."""
     def __init__(self, fdesc):
         self.desc = fdesc
@@ -1076,7 +1076,7 @@
                 return (class_str, descr)
     return None
 
-class CardApplication(object):
+class CardApplication:
     """A card application is represented by an ADF (with contained hierarchy) and optionally
        some SW definitions."""
     def __init__(self, name, adf:Optional[CardADF]=None, aid:str=None, sw:dict=None):
@@ -1109,7 +1109,7 @@
         """
         return interpret_sw(self.sw, sw)
 
-class CardProfile(object):
+class CardProfile:
     """A Card Profile describes a card, it's filessystem 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."""
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index f946af8..d8579a3 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -23,7 +23,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-class LinkBase(object):
+class LinkBase:
 	"""Base class for link/transport to card."""
 
 	def wait_for_card(self, timeout:int=None, newcardonly:bool=False):
diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py
index 467d5ee..49d649d 100644
--- a/pySim/transport/calypso.py
+++ b/pySim/transport/calypso.py
@@ -25,7 +25,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)

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/23633
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I15003ba591510d68f3235f71526ad5d8a456088e
Gerrit-Change-Number: 23633
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210405/dfebce65/attachment.htm>


More information about the gerrit-log mailing list