diff options
| author | Tim Graham <timograham@gmail.com> | 2014-12-24 19:27:51 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-12-24 19:29:33 -0500 |
| commit | 426ead27bd2a38766017d9332ae4143ad9c7a2ab (patch) | |
| tree | bead5f55e5e7a966604b3022163b23eaaa7fa6b9 | |
| parent | 6571ed14b68821b1e20a33d8d37c7f33dd0d524f (diff) | |
Removed shutil.copystat copied from stdlib (added to support an old Python?).
| -rw-r--r-- | django/core/files/move.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/django/core/files/move.py b/django/core/files/move.py index 902cd1fada..124529d9b9 100644 --- a/django/core/files/move.py +++ b/django/core/files/move.py @@ -6,21 +6,10 @@ Move a file in the safest way possible:: """ import os -from django.core.files import locks +from shutil import copystat -try: - from shutil import copystat -except ImportError: - import stat +from django.core.files import locks - def copystat(src, dst): - """Copy all stat info (mode bits, atime and mtime) from src to dst""" - st = os.stat(src) - mode = stat.S_IMODE(st.st_mode) - if hasattr(os, 'utime'): - os.utime(dst, (st.st_atime, st.st_mtime)) - if hasattr(os, 'chmod'): - os.chmod(dst, mode) __all__ = ['file_move_safe'] |
