77
88try :
99 import abc
10- import binascii
1110 import os
1211 import re
1312 import sys
1817 from sonic_py_common import device_info
1918 from sonic_py_common .interface import backplane_prefix
2019
21- from . import bcmshell # Dot module supports both Python 2 and Python 3 using explicit relative import methods
2220 from sonic_eeprom import eeprom_dts
2321 from .sff8472 import sff8472InterfaceId # Dot module supports both Python 2 and Python 3 using explicit relative import methods
2422 from .sff8472 import sff8472Dom # Dot module supports both Python 2 and Python 3 using explicit relative import methods
@@ -283,7 +281,7 @@ def _sfp_eeprom_present(self, sysfs_sfp_i2c_client_eeprompath, offset):
283281 sysfsfile .read (1 )
284282 except IOError :
285283 return False
286- except :
284+ except Exception :
287285 return False
288286 else :
289287 return True
@@ -342,7 +340,7 @@ def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes):
342340 try :
343341 for n in range (0 , num_bytes ):
344342 eeprom_raw [n ] = hex (ord (raw [n ]))[2 :].zfill (2 )
345- except :
343+ except Exception :
346344 return None
347345
348346 return eeprom_raw
@@ -364,7 +362,7 @@ def _read_eeprom_devid(self, port_num, devid, offset, num_bytes = 256):
364362
365363 try :
366364 sysfsfile_eeprom .close ()
367- except :
365+ except Exception :
368366 return None
369367
370368 return eeprom_raw
@@ -395,7 +393,7 @@ def _write_eeprom_devid(self, port_num, devid, offset, num_bytes, write_buffer):
395393
396394 try :
397395 sysfsfile_eeprom .close ()
398- except :
396+ except Exception :
399397 return False
400398
401399 return True
@@ -468,7 +466,7 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0):
468466
469467 try :
470468 f = open (porttabfile )
471- except :
469+ except Exception :
472470 raise
473471
474472 # Read the porttab file and generate dicts
@@ -571,7 +569,7 @@ def read_phytab_mappings(self, phytabfile):
571569
572570 try :
573571 f = open (phytabfile )
574- except :
572+ except Exception :
575573 raise
576574
577575 # Read the phytab file and generate dicts
0 commit comments