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

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


Module: kamailio
Branch: 5.2
Commit: d3ee5a3e16750655c0c106613028b27a8d00e427
URL: https://github.com/kamailio/kamailio/commit/d3ee5a3e16750655c0c106613028b27a8d00e427

Author: Henning Westerholt <hw at skalatan.de>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2019-09-21T21:25:20+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/d3ee5a3e16750655c0c106613028b27a8d00e427.diff
Patch: https://github.com/kamailio/kamailio/commit/d3ee5a3e16750655c0c106613028b27a8d00e427.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