Fix XendLogging to work on Python 2.4.0 and 2.4.1 (the logging library interface
authorEwan Mellor <ewan@xensource.com>
Tue, 6 Feb 2007 15:37:11 +0000 (15:37 +0000)
committerEwan Mellor <ewan@xensource.com>
Tue, 6 Feb 2007 15:37:11 +0000 (15:37 +0000)
changed with 2.4.2, not 2.4.0).

Signed-off-by: Qing He <qing.he@intel.com>
tools/python/xen/xend/XendLogging.py

index e889449fd088f48f2a926b6010e0b6cb7e4ff92e..6d6140188d26477419dba3e8af7569d78b2ec498 100644 (file)
@@ -52,8 +52,8 @@ if 'TRACE' not in logging.__dict__:
         for frame in frames:
             filename = os.path.normcase(frame[1])
             if filename != thisfile and filename != logging._srcfile:
-                major, minor, _, _, _ = sys.version_info
-                if major == 2 and minor >= 4:
+                major, minor, micro, _, _ = sys.version_info
+                if (major, minor, micro) >= (2, 4, 2):
                     return filename, frame[2], frame[3]
                 else:
                     return filename, frame[2]