subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Fogel <kfo...@red-bean.com>
Subject [PATCH] Better error message for svn bindings import in mailer.py.
Date Mon, 12 Feb 2018 21:04:38 GMT
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)
 
 


Mime
View raw message