(src, dst)
| 150 | |
| 151 | |
| 152 | def safe_copy(src, dst): |
| 153 | logger.debug('copy: %s -> %s', src, dst) |
| 154 | src = os.path.abspath(src) |
| 155 | dst = os.path.abspath(dst) |
| 156 | if os.path.isdir(dst): |
| 157 | dst = os.path.join(dst, os.path.basename(src)) |
| 158 | if src == dst: |
| 159 | return |
| 160 | if dst == os.devnull: |
| 161 | return |
| 162 | # Copies data and permission bits, but not other metadata such as timestamp |
| 163 | shutil.copy(src, dst) |
| 164 | # We always want the target file to be writable even when copying from |
| 165 | # read-only source. (e.g. a read-only install of emscripten). |
| 166 | make_writable(dst) |
| 167 | |
| 168 | |
| 169 | def read_file(file_path): |
no test coverage detected