7
7
8
8
try :
9
9
import abc
10
- import binascii
11
10
import os
12
11
import re
13
12
import sys
18
17
from sonic_py_common import device_info
19
18
from sonic_py_common .interface import backplane_prefix
20
19
21
- from . import bcmshell # Dot module supports both Python 2 and Python 3 using explicit relative import methods
22
20
from sonic_eeprom import eeprom_dts
23
21
from .sff8472 import sff8472InterfaceId # Dot module supports both Python 2 and Python 3 using explicit relative import methods
24
22
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):
283
281
sysfsfile .read (1 )
284
282
except IOError :
285
283
return False
286
- except :
284
+ except Exception :
287
285
return False
288
286
else :
289
287
return True
@@ -342,7 +340,7 @@ def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes):
342
340
try :
343
341
for n in range (0 , num_bytes ):
344
342
eeprom_raw [n ] = hex (ord (raw [n ]))[2 :].zfill (2 )
345
- except :
343
+ except Exception :
346
344
return None
347
345
348
346
return eeprom_raw
@@ -364,7 +362,7 @@ def _read_eeprom_devid(self, port_num, devid, offset, num_bytes = 256):
364
362
365
363
try :
366
364
sysfsfile_eeprom .close ()
367
- except :
365
+ except Exception :
368
366
return None
369
367
370
368
return eeprom_raw
@@ -395,7 +393,7 @@ def _write_eeprom_devid(self, port_num, devid, offset, num_bytes, write_buffer):
395
393
396
394
try :
397
395
sysfsfile_eeprom .close ()
398
- except :
396
+ except Exception :
399
397
return False
400
398
401
399
return True
@@ -468,7 +466,7 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0):
468
466
469
467
try :
470
468
f = open (porttabfile )
471
- except :
469
+ except Exception :
472
470
raise
473
471
474
472
# Read the porttab file and generate dicts
@@ -571,7 +569,7 @@ def read_phytab_mappings(self, phytabfile):
571
569
572
570
try :
573
571
f = open (phytabfile )
574
- except :
572
+ except Exception :
575
573
raise
576
574
577
575
# Read the phytab file and generate dicts
0 commit comments