[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Better error message for svn bindings import in mailer.py.

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Mon, 12 Feb 2018 16:15:30 -0500

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
Received on 2018-02-12 22:15:50 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.