File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1111
1212 from sonic_py_common import daemon_base
1313 from swsscommon import swsscommon
14- except ImportError , e :
14+ except ImportError as e :
1515 raise ImportError (str (e ) + " - required module not found" )
1616
1717#============================= Constants =============================
@@ -45,17 +45,17 @@ class DaemonLedd(daemon_base.DaemonBase):
4545 (options , remainder ) = getopt .getopt (sys .argv [1 :],
4646 'hv' ,
4747 ['help' , 'version' ])
48- except getopt .GetoptError , e :
49- print e
50- print USAGE_HELP
48+ except getopt .GetoptError as e :
49+ print ( e )
50+ print ( USAGE_HELP )
5151 sys .exit (2 )
5252
5353 for opt , arg in options :
5454 if opt == '--help' or opt == '-h' :
55- print USAGE_HELP
55+ print ( USAGE_HELP )
5656 sys .exit (0 )
5757 elif opt == '--version' or opt == '-v' :
58- print 'ledd version ' + VERSION
58+ print ( 'ledd version ' + VERSION )
5959 sys .exit (0 )
6060
6161 # Load platform-specific LedControl module
Original file line number Diff line number Diff line change 1515 import swsssdk
1616 from sonic_py_common .daemon_base import DaemonBase
1717 from sonic_py_common .device_info import get_platform
18- except ImportError , e :
18+ except ImportError as e :
1919 raise ImportError (str (e ) + " - required module not found" )
2020
2121#
Original file line number Diff line number Diff line change 1616
1717 from sonic_py_common import daemon_base
1818 from swsscommon import swsscommon
19- except ImportError , e :
19+ except ImportError as e :
2020 raise ImportError (str (e ) + " - required module not found" )
2121
2222#
Original file line number Diff line number Diff line change 1515
1616 from sonic_py_common import daemon_base
1717 from swsscommon import swsscommon
18- except ImportError , e :
18+ except ImportError as e :
1919 raise ImportError (str (e ) + " - required module not found" )
2020
2121PLATFORM_SPECIFIC_MODULE_NAME = 'eeprom'
Original file line number Diff line number Diff line change 1919 from enum import Enum
2020 from sonic_py_common import daemon_base , device_info , logger
2121 from swsscommon import swsscommon
22- except ImportError , e :
22+ except ImportError as e :
2323 raise ImportError (str (e ) + " - required module not found" )
2424
2525#
@@ -1128,7 +1128,7 @@ class DaemonXcvrd(daemon_base.DaemonBase):
11281128 try :
11291129 port_config_file_path = device_info .get_path_to_port_config_file ()
11301130 platform_sfputil .read_porttab_mappings (port_config_file_path )
1131- except Exception , e :
1131+ except Exception as e :
11321132 self .log_error ("Failed to read port info: %s" % (str (e )), True )
11331133 sys .exit (PORT_CONFIG_LOAD_ERROR )
11341134
You can’t perform that action at this time.
0 commit comments