On 02/12/2018 04:04 PM, Karl Fogel wrote:
> Hi all.  I think one of the import error messages in 
> tools/hook-scripts/mailer/mailer.py is misleading (I discovered this while 
> debugging the problem that Troy Curtis Jr. solved in r1823802).  Any 
> objections if I install this patch?
>
> [[[
> Give correct error message on failure to import Subversion Python bindings.
>
> * tools/hook-scripts/mailer/mailer.py: If the Subversion Python bindings
>   could not be found for import at all, have the error message state
>   that clearly, instead of duplicating the error message used for
>   importing too old a version of the bindings.
> ]]]
>
> Index: tools/hook-scripts/mailer/mailer.py
> ===================================================================
> --- tools/hook-scripts/mailer/mailer.py       (revision 1823993)
> +++ 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)
>  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)
>  
>  

+1

Reply via email to