(cmd)
| 1123 | |
| 1124 | |
| 1125 | def run_shell_command(cmd): |
| 1126 | try: |
| 1127 | output = subprocess.check_output([cmd], shell=True) |
| 1128 | return output.decode("utf8").strip() |
| 1129 | except subprocess.CalledProcessError as e: |
| 1130 | if "Cannot detect installation path" in str(e.output): |
| 1131 | logging.warning("Uninstaller did not find previous installation") |
| 1132 | elif "ldconfig" in str(e.cmd): |
| 1133 | logging.debug("Cannot detect libcudart via ldconfig") |
| 1134 | elif "nvcc" in str(e.cmd): |
| 1135 | logging.debug("Cannot detect CUDA via nvcc") |
| 1136 | else: |
| 1137 | logging.error( |
| 1138 | "Exception on process - rc= %s output= %s command= %s", |
| 1139 | e.returncode, |
| 1140 | e.output, |
| 1141 | e.cmd, |
| 1142 | ) |
| 1143 | |
| 1144 | return "" |
| 1145 | |
| 1146 | |
| 1147 | def get_latest_github_release(repo): |
no test coverage detected