mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
Patch #103342: Make shutil.copytree more useful under Jython.
This commit is contained in:
parent
d304f44906
commit
0c94724cc7
@ -34,16 +34,19 @@ def copyfile(src, dst):
|
||||
|
||||
def copymode(src, dst):
|
||||
"""Copy mode bits from src to dst"""
|
||||
st = os.stat(src)
|
||||
mode = stat.S_IMODE(st[stat.ST_MODE])
|
||||
os.chmod(dst, mode)
|
||||
if hasattr(os, 'chmod'):
|
||||
st = os.stat(src)
|
||||
mode = stat.S_IMODE(st[stat.ST_MODE])
|
||||
os.chmod(dst, mode)
|
||||
|
||||
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[stat.ST_MODE])
|
||||
os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME]))
|
||||
os.chmod(dst, mode)
|
||||
if hasattr(os, 'utime'):
|
||||
os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME]))
|
||||
if hasattr(os, 'chmod'):
|
||||
os.chmod(dst, mode)
|
||||
|
||||
|
||||
def copy(src, dst):
|
||||
|
Loading…
Reference in New Issue
Block a user