(d)
| 1354 | |
| 1355 | # Removes a directory tree even if it was readonly, and doesn't throw exception on failure. |
| 1356 | def remove_tree(d): |
| 1357 | os.chmod(d, stat.S_IWRITE) |
| 1358 | try: |
| 1359 | def remove_readonly_and_try_again(func, path, exc_info): |
| 1360 | if not (os.stat(path).st_mode & stat.S_IWRITE): |
| 1361 | os.chmod(path, stat.S_IWRITE) |
| 1362 | func(path) |
| 1363 | else: |
| 1364 | raise exc_info[1] |
| 1365 | shutil.rmtree(d, onerror=remove_readonly_and_try_again) |
| 1366 | except Exception: |
| 1367 | pass |
| 1368 | |
| 1369 | |
| 1370 | def get_system_info(format_json): |
no outgoing calls
no test coverage detected