diff --git a/dcm2bids/version.py b/dcm2bids/version.py index 8429a0cd..dd7a8448 100644 --- a/dcm2bids/version.py +++ b/dcm2bids/version.py @@ -10,7 +10,7 @@ import shlex import socket from distutils.version import LooseVersion -from subprocess import check_output +from subprocess import check_output, CalledProcessError, TimeoutExpired from shutil import which @@ -41,11 +41,14 @@ def check_github_latest(githubRepo, timeout=3): url = "https://github.com/{}/releases/latest".format(githubRepo) try: output = check_output(shlex.split("curl --silent " + url), timeout=timeout) - except: + except CalledProcessError: logger.info(f"Checking latest version of {githubRepo} was not possible") logger.debug(f"Error while 'curl --silent {url}'", exc_info=True) return - + except TimeoutExpired: + logger.info(f"Checking latest version of {githubRepo} was not possible") + logger.debug(f"Command 'curl --silent {url}' timed out after {timeout}s") + return # The output should have this format #
You are being redirected. try: