]> code.ossystems Code Review - openembedded-core.git/commitdiff
parse: Use constants from stat instead of magic numbers
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 3 Jan 2011 19:57:19 +0000 (20:57 +0100)
committerRichard Purdie <rpurdie@linux.intel.com>
Tue, 4 Jan 2011 15:00:07 +0000 (15:00 +0000)
(Bitbake rev: bcabe2dfb587042e139890329ff52d9bb9201cf4)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
bitbake/lib/bb/parse/__init__.py

index 7f1562e66efeb19e734507a20d8f5b2d97ebed13..eee8d9cddb915af58e8a79e86dd19a1a527144ff 100644 (file)
@@ -27,6 +27,7 @@ File parsers for the BitBake build tools.
 handlers = []
 
 import os
+import stat
 import logging
 import bb
 import bb.utils
@@ -43,19 +44,19 @@ class SkipPackage(Exception):
 __mtime_cache = {}
 def cached_mtime(f):
     if f not in __mtime_cache:
-        __mtime_cache[f] = os.stat(f)[8]
+        __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
     return __mtime_cache[f]
 
 def cached_mtime_noerror(f):
     if f not in __mtime_cache:
         try:
-            __mtime_cache[f] = os.stat(f)[8]
+            __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
         except OSError:
             return 0
     return __mtime_cache[f]
 
 def update_mtime(f):
-    __mtime_cache[f] = os.stat(f)[8]
+    __mtime_cache[f] = os.stat(f)[stat.ST_MTIME]
     return __mtime_cache[f]
 
 def mark_dependency(d, f):