[sr-dev] git:5.1:cd0fe9e4: tools: fix python exception usage in route_graph.py tool

Henning Westerholt hw at skalatan.de
Sat Sep 21 21:27:50 CEST 2019


Module: kamailio
Branch: 5.1
Commit: cd0fe9e469c60be0b5c22cfa62f33cc70c12bb1f
URL: https://github.com/kamailio/kamailio/commit/cd0fe9e469c60be0b5c22cfa62f33cc70c12bb1f

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-09-21T21:25:25+02:00

tools: fix python exception usage in route_graph.py tool

(cherry picked from commit 4a66e500ddb6028d3dfcf67aca951282309b6ea4)

---

Modified: misc/tools/route_graph/route_graph.py

---

Diff:  https://github.com/kamailio/kamailio/commit/cd0fe9e469c60be0b5c22cfa62f33cc70c12bb1f.diff
Patch: https://github.com/kamailio/kamailio/commit/cd0fe9e469c60be0b5c22cfa62f33cc70c12bb1f.patch

---

diff --git a/misc/tools/route_graph/route_graph.py b/misc/tools/route_graph/route_graph.py
index 135440a3c5..b416bdc186 100755
--- a/misc/tools/route_graph/route_graph.py
+++ b/misc/tools/route_graph/route_graph.py
@@ -75,12 +75,12 @@ def traverse_routes(_level, _name):
 
 
 if len(sys.argv) < 2:
-	raise "usage: %s configuration-file [max_depth]" % sys.argv[0]
+	raise Exception('wrong number of arguments\nusage: ' + sys.argv[0] + ' configuration-file [max_depth]')
 if len(sys.argv) == 3:
 	max_depth = int(sys.argv[2])
 cfg = file(sys.argv[1], "r")
 if cfg is None:
-	raise "Missing config file"
+	raise Exception ('Missing config file')
 line = cfg.readline()
 rt = routes
 while line:




More information about the sr-dev mailing list