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

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

From: Karl Fogel <kfogel_at_red-bean.com>
Date: Mon, 12 Feb 2018 15:04:38 -0600

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)
 
 
Received on 2018-02-12 22:04:46 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.