diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> | 2012-11-29 21:30:35 +0100 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> | 2012-11-29 21:30:35 +0100 |
commit | 90abd1ee06f66fe094c87763e501a64be82915c5 (patch) | |
tree | 4630dd5d5d8cc5b73577f7787a4f9f804d552d42 | |
parent | c74a19691f5cbc0ec070d5fd4ffe1983bde05a09 (diff) | |
download | portage-90abd1ee06f66fe094c87763e501a64be82915c5.tar.gz portage-90abd1ee06f66fe094c87763e501a64be82915c5.tar.bz2 portage-90abd1ee06f66fe094c87763e501a64be82915c5.zip |
Fix return value of portage.util.movefile.movefile() for symlinks with Python >=3.3.
-rw-r--r-- | pym/portage/util/movefile.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/util/movefile.py b/pym/portage/util/movefile.py index b9c418347..98cf86a41 100644 --- a/pym/portage/util/movefile.py +++ b/pym/portage/util/movefile.py @@ -163,8 +163,11 @@ def movefile(src, dest, newmtime=None, sstat=None, mysettings=None, raise lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) # utime() only works on the target of a symlink, so it's not - # possible to perserve mtime on symlinks. - return os.lstat(dest)[stat.ST_MTIME] + # possible to preserve mtime on symlinks. + if sys.hexversion >= 0x3030000: + return os.stat(dest, follow_symlinks=False).st_mtime_ns + else: + return os.lstat(dest)[stat.ST_MTIME] except SystemExit as e: raise except Exception as e: |