Skip to contentSkip to conversation

Don't lazily import the signal module

PATCH In review Jeremy Katz 2 participants 2 messages Sep 6, 2006 – Sep 8, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't lazily import the signal module

Lazy imports are a quick way to cause a traceback, especially when code starts being moved around or copied elsewhere.

tools/python/xen/xend/image.py +1 -1
diff -r 780409e8f0ba tools/python/xen/xend/image.py
@@ -20,6 +20,7 @@ import os, string
 import os, string
 import re
 import math
+import signal
 
 import xen.lowlevel.xc
 from xen.xend import sxp
@@ -386,7 +387,6 @@ class HVMImageHandler(ImageHandler):
 
     def destroy(self):
         self.unregister_shutdown_watch();
-        import signal
         if not self.pid:
             return
         os.kill(self.pid, signal.SIGKILL)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 4 lines

Lazy imports are a quick way to cause a traceback, especially when code starts being moved around or copied elsewhere.

Hmm... We do the same thing in a couple of other places as well. I think I'd rather wait until after 3.0.3 and then clean them all up in one go.

Thanks,

Steven.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel