Karl Fogel wrote on Mon, 12 Feb 2018 15:04 -0600:
> +++ tools/hook-scripts/mailer/mailer.py       (working copy)
> @@ -70,23 +70,21 @@
>  _MIN_SVN_VERSION = [1, 5, 0]
>  
>  # Import the Subversion Python bindings, making sure they meet our
>  # minimum version requirements.
>  try:
>    import svn.fs
>    import svn.delta
>    import svn.repos
>    import svn.core
>  except ImportError:
> -  sys.stderr.write(
> -    "You need version %s or better of the Subversion Python bindings.\n" \
> -    % ".".join([str(x) for x in _MIN_SVN_VERSION]))
> +  sys.stderr.write("Unable to import Subversion Python bindings.\n")
>    sys.exit(1)

It would be useful to also print the caught exception in case it contains more
specific information about the cause of the problem…

… but in that case, why not remove the try/except entirely?

>  if _MIN_SVN_VERSION > [svn.core.SVN_VER_MAJOR,
>                         svn.core.SVN_VER_MINOR,
>                         svn.core.SVN_VER_PATCH]:
>    sys.stderr.write(
>      "You need version %s or better of the Subversion Python bindings.\n" \
>      % ".".join([str(x) for x in _MIN_SVN_VERSION]))
>    sys.exit(1)

Reply via email to