Use Python 3.x compatible except construct
Python 3.x deprecated excecpt x,y. Use except x as y, which works with any Python version >= 2.6 Change-Id: I264049ee41e75bcedea86adf7c2011c343f47ddb
This commit is contained in:
parent
580c554c19
commit
9db6e14a45
|
@ -61,5 +61,5 @@ if __name__ == '__main__':
|
|||
server = wsgi.Server()
|
||||
server.start(app, cfg.CONF, default_port=port)
|
||||
server.wait()
|
||||
except RuntimeError, e:
|
||||
except RuntimeError as e:
|
||||
sys.exit("ERROR: %s" % e)
|
||||
|
|
|
@ -63,5 +63,5 @@ if __name__ == '__main__':
|
|||
server = wsgi.Server()
|
||||
server.start(app, cfg.CONF, default_port=port)
|
||||
server.wait()
|
||||
except RuntimeError, e:
|
||||
except RuntimeError as e:
|
||||
sys.exit("ERROR: %s" % e)
|
||||
|
|
|
@ -682,7 +682,7 @@ Commands:
|
|||
sys.exit(result)
|
||||
except (RuntimeError,
|
||||
NotImplementedError,
|
||||
exception.ClientConfigurationError), ex:
|
||||
exception.ClientConfigurationError) as ex:
|
||||
oparser.print_usage()
|
||||
logging.error("ERROR: %s" % ex)
|
||||
sys.exit(1)
|
||||
|
|
|
@ -270,7 +270,7 @@ Commands:
|
|||
sys.exit(result)
|
||||
except (RuntimeError,
|
||||
NotImplementedError,
|
||||
exception.ClientConfigurationError), ex:
|
||||
exception.ClientConfigurationError) as ex:
|
||||
oparser.print_usage()
|
||||
logging.error("ERROR: %s" % ex)
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Reference in New Issue