diff --git a/probeCOCOATek/probeCOCOATek.py b/probeCOCOATek/probeCOCOATek.py index a569e9e..518398c 100755 --- a/probeCOCOATek/probeCOCOATek.py +++ b/probeCOCOATek/probeCOCOATek.py @@ -1,7 +1,5 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -if sys.version_info.major == 3 and sys.version_info.minor >= 7: - from __future__ import annotations import sys import os import io @@ -17,7 +15,6 @@ from probeCOCOATek import __version__ from probeCOCOATek.TemporaryExposureKey.TemporaryExposureKey_pb2 import TemporaryExposureKeyExport - class Error(Exception): pass class AugumentError(Error): @@ -102,7 +99,7 @@ def _get_zip_file(self, filename:str) -> bytes: return zip_content - def _extract_key_zip(self, zip_content:bytes) -> tuple(bytes, bytes): + def _extract_key_zip(self, zip_content:bytes) -> (bytes, bytes): try: z = zipfile.ZipFile(io.BytesIO(zip_content)) except zipfile.BadZipFile as e: @@ -116,7 +113,7 @@ def _parse_export_key(self, pb_bin:bytes) -> TemporaryExposureKeyExport: tek_bin.ParseFromString(pb_bin) except pbm.DecodeError as e: #print('DecodeError: {}'.format(e)) - None + pass except Exception as e: print('Error: {}'.format(e)) return tek_bin