summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-01-21 20:00:00 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-01-21 20:00:00 (GMT)
commit0c94724cc77a004973fb0105417c084234c2da73 (patch)
tree064abe6cf3081c6bdccf3f42772ffbac12036c16 /Lib/shutil.py
parentd304f44906b818c7e336fcbb99241516c9170d29 (diff)
downloadcpython-0c94724cc77a004973fb0105417c084234c2da73.zip
cpython-0c94724cc77a004973fb0105417c084234c2da73.tar.gz
cpython-0c94724cc77a004973fb0105417c084234c2da73.tar.bz2
Patch #103342: Make shutil.copytree more useful under Jython.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r--Lib/shutil.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 1ba58da..e053917 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -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):