Change in pysim[master]: profile: decode_select_response use object instead 'Any'

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/.

dexter gerrit-no-reply at lists.osmocom.org
Tue Nov 16 14:53:35 UTC 2021


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


Change subject: profile: decode_select_response use object instead 'Any'
......................................................................

profile: decode_select_response use object instead 'Any'

the return type of decode_select_response is 'Any', lets be more
specific and use 'object'

Change-Id: Ic5c7ace234bc94ab1381d87e091369ade8011cab
---
M pySim/filesystem.py
M pySim/profile.py
M pySim/ts_102_221.py
M pySim/ts_51_011.py
4 files changed, 5 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/77/26277/1

diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 6b20db5..4c3308c 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -34,7 +34,7 @@
 from cmd2 import CommandSet, with_default_category, with_argparser
 import argparse
 
-from typing import cast, Optional, Iterable, List, Any, Dict, Tuple
+from typing import cast, Optional, Iterable, List, Dict, Tuple
 
 from smartcard.util import toBytes
 
@@ -354,7 +354,7 @@
                 sels.update({x.name: x for x in self.applications.values() if x.name})
         return sels
 
-    def decode_select_response(self, data_hex:str) -> Any:
+    def decode_select_response(self, data_hex:str) -> object:
         """Decode the response to a SELECT command.
 
         This is the fall-back method which automatically defers to the standard decoding
diff --git a/pySim/profile.py b/pySim/profile.py
index d430f02..13d54bb 100644
--- a/pySim/profile.py
+++ b/pySim/profile.py
@@ -24,7 +24,6 @@
 from pySim.commands import SimCardCommands
 from pySim.filesystem import CardApplication, interpret_sw
 from pySim.utils import all_subclasses
-from typing import Any
 import abc
 import operator
 
@@ -119,7 +118,7 @@
 		return interpret_sw(self.sw, sw)
 
 	@staticmethod
-	def decode_select_response(data_hex:str) -> Any:
+	def decode_select_response(data_hex:str) -> object:
 		"""Decode the response to a SELECT command.
 
 		This is the fall-back method which doesn't perform any decoding. It mostly
diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py
index 0aa5e89..59244cc 100644
--- a/pySim/ts_102_221.py
+++ b/pySim/ts_102_221.py
@@ -673,7 +673,7 @@
         super().__init__(name, desc='ETSI TS 102 221', cla="00", sel_ctrl="0004", files_in_mf=files, sw=sw)
 
     @staticmethod
-    def decode_select_response(resp_hex:str) -> Any:
+    def decode_select_response(resp_hex:str) -> object:
         """ETSI TS 102 221 Section 11.1.1.3"""
         fixup_fcp_proprietary_tlv_map(FCP_Proprietary_TLV_MAP)
         resp_hex = resp_hex.upper()
diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py
index e10a61b..2c74c61 100644
--- a/pySim/ts_51_011.py
+++ b/pySim/ts_51_011.py
@@ -979,7 +979,7 @@
         super().__init__('SIM', desc='GSM SIM Card', cla="a0", sel_ctrl="0000", files_in_mf=[DF_TELECOM(), DF_GSM()], sw=sw)
 
     @staticmethod
-    def decode_select_response(resp_hex:str) -> Any:
+    def decode_select_response(resp_hex:str) -> object:
         resp_bin = h2b(resp_hex)
         struct_of_file_map = {
             0: 'transparent',

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5c7ace234bc94ab1381d87e091369ade8011cab
Gerrit-Change-Number: 26277
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211116/205962d9/attachment.htm>


More information about the gerrit-log mailing list