(target: AnyStr, link_name: AnyStr, force: bool = False)
| 190 | |
| 191 | |
| 192 | def make_symlink(target: AnyStr, link_name: AnyStr, force: bool = False): |
| 193 | if force and os.path.lexists(link_name): |
| 194 | os.remove(link_name) |
| 195 | try: |
| 196 | os.symlink(target, link_name) |
| 197 | except OSError as e: |
| 198 | if e.errno == errno.EEXIST: |
| 199 | if os.path.islink(link_name): |
| 200 | link = os.readlink(link_name) |
| 201 | if os.path.abspath(target) != os.path.abspath(link): |
| 202 | raise e |
| 203 | else: |
| 204 | raise e |
| 205 | else: |
| 206 | raise e |
| 207 | |
| 208 | |
| 209 | def sign_file(file_path, key_path, signature_path=None): |
no test coverage detected