aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-08-01 01:07:31 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-08-01 01:07:31 +0200
commit907adbeeb89176c63ad7a04288e080f08f3eb401 (patch)
treef4df8f13d403b54e6256f8d49c8a6594b8cde1ce /pym
parentUse nanosecond precision in portage.util.movefile.movefile(). (diff)
downloadportage-907adbeeb89176c63ad7a04288e080f08f3eb401.tar.gz
portage-907adbeeb89176c63ad7a04288e080f08f3eb401.tar.bz2
portage-907adbeeb89176c63ad7a04288e080f08f3eb401.zip
Use nanosecond precision in cache for category directory mtimes
and cache for cp_list results when using Python >=3.3.
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 08580e807..5008a97fb 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -376,7 +376,10 @@ class vardbapi(dbapi):
if mysplit[0] == '*':
mysplit[0] = mysplit[0][1:]
try:
- mystat = os.stat(self.getpath(mysplit[0])).st_mtime
+ if sys.hexversion >= 0x3030000:
+ mystat = os.stat(self.getpath(mysplit[0])).st_mtime_ns
+ else:
+ mystat = os.stat(self.getpath(mysplit[0])).st_mtime
except OSError:
mystat = 0
if use_cache and mycp in self.cpcache:
@@ -511,7 +514,10 @@ class vardbapi(dbapi):
return list(self._iter_match(mydep,
self.cp_list(mydep.cp, use_cache=use_cache)))
try:
- curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime
+ if sys.hexversion >= 0x3030000:
+ curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime_ns
+ else:
+ curmtime = os.stat(os.path.join(self._eroot, VDB_PATH, mycat)).st_mtime
except (IOError, OSError):
curmtime=0