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

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

tools: use correct check of None instead of wrong comparison in route_graph.py 
tool

(cherry picked from commit 545ef51912ae9bf5e14eaffeb9f41be8359a442f)

---

Modified: misc/tools/route_graph/route_graph.py

---

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

---

diff --git a/misc/tools/route_graph/route_graph.py 
b/misc/tools/route_graph/route_graph.py
index 2024cf42a0..135440a3c5 100755
--- a/misc/tools/route_graph/route_graph.py
+++ b/misc/tools/route_graph/route_graph.py
@@ -79,7 +79,7 @@ def traverse_routes(_level, _name):
 if len(sys.argv) == 3:
        max_depth = int(sys.argv[2])
 cfg = file(sys.argv[1], "r")
-if cfg == None:
+if cfg is None:
        raise "Missing config file"
 line = cfg.readline()
 rt = routes
@@ -90,40 +90,40 @@ def traverse_routes(_level, _name):
                main_match = re_main_route.search(line)
                def_match = re_def_route.search(line)
                call_match = re_call_route.search(line)
-               if not call_match == None:
+               if not call_match is None:
                        log("CALL: " + line)
                        name = call_match.group(2)
                        log(rname +":"+name)
                        rt[rname].append(name)
-               elif not def_match == None:
+               elif not def_match is None:
                        log("DEF: " + line)
                        rtype = def_match.group(1)
                        rname = def_match.group(3)
                        if rtype == "failure_":
                                rt = f_routes
-                               if rname == None:
+                               if rname is None:
                                        rname = "failure"
                        elif rtype == "onreply_":
                                rt = r_routes
-                               if rname == None:
+                               if rname is None:
                                        rname = "onreply"
                        elif rtype == "onsend_":
                                rt = s_routes
-                               if rname == None:
+                               if rname is None:
                                        rname = "onsend"
                        elif rtype == "branch_":
                                rt = b_routes
-                               if rname == None:
+                               if rname is None:
                                        rname = "branch"
                        elif rtype == "event_":
                                rt = e_routes
-                               if rname == None:
+                               if rname is None:
                                        rname = "event"
                        else:
                                rt = routes
                        log(rname)
                        rt[rname] = []
-               elif not main_match == None:
+               elif not main_match is None:
                        log("MAIN: " + line)
                        rtype = main_match.group(1)
                        if rtype == "failure_":


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to