Kaydet (Commit) 0c94724c authored tarafından Tim Peters's avatar Tim Peters

Patch #103342: Make shutil.copytree more useful under Jython.

üst d304f449
...@@ -34,6 +34,7 @@ def copyfile(src, dst): ...@@ -34,6 +34,7 @@ def copyfile(src, dst):
def copymode(src, dst): def copymode(src, dst):
"""Copy mode bits from src to dst""" """Copy mode bits from src to dst"""
if hasattr(os, 'chmod'):
st = os.stat(src) st = os.stat(src)
mode = stat.S_IMODE(st[stat.ST_MODE]) mode = stat.S_IMODE(st[stat.ST_MODE])
os.chmod(dst, mode) os.chmod(dst, mode)
...@@ -42,7 +43,9 @@ def copystat(src, dst): ...@@ -42,7 +43,9 @@ def copystat(src, dst):
"""Copy all stat info (mode bits, atime and mtime) from src to dst""" """Copy all stat info (mode bits, atime and mtime) from src to dst"""
st = os.stat(src) st = os.stat(src)
mode = stat.S_IMODE(st[stat.ST_MODE]) mode = stat.S_IMODE(st[stat.ST_MODE])
if hasattr(os, 'utime'):
os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME])) os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME]))
if hasattr(os, 'chmod'):
os.chmod(dst, mode) os.chmod(dst, mode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment