ovs.json: Optimize __dump_string().
[openvswitch] / python / ovs / process.py
index 094e085331832b9576208700db9d2c91759e34ed..f8182f197d3925d7871fb43818f6a5c283ddc3d6 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 Nicira Networks
+# Copyright (c) 2010, 2011 Nicira Networks
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 import os
 import signal
 
-def _signal_status_msg(type, signr):
-    s = "%s by signal %d" % (type, signr)
+def _signal_status_msg(type_, signr):
+    s = "%s by signal %d" % (type_, signr)
     for name in signal.__dict__:
-        if name.startswith("SIG") and signal.__dict__[name] == signr:
+        if name.startswith("SIG") and getattr(signal, name) == signr:
             return "%s (%s)" % (s, name)
     return s