[diffoscope] 01/04: presenters.html: Raise a nicer error if trying to use --html-dir on a file

Chris Lamb chris at chris-lamb.co.uk
Mon Jan 2 11:14:28 CET 2017


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit ece38683d447941575541f489827d2e6981052fa
Author: Chris Lamb <lamby at debian.org>
Date:   Sun Jan 1 23:29:36 2017 +0000

    presenters.html: Raise a nicer error if trying to use --html-dir on a file
---
 diffoscope/presenters/html/html.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/diffoscope/presenters/html/html.py b/diffoscope/presenters/html/html.py
index 9b9f897..42245fe 100644
--- a/diffoscope/presenters/html/html.py
+++ b/diffoscope/presenters/html/html.py
@@ -518,6 +518,9 @@ def output_html_directory(directory, difference, css_url=None, jquery_url=None):
     if not os.path.exists(directory):
         os.makedirs(directory)
 
+    if not os.path.isdir(directory):
+        raise ValueError("%s is not a directory" % directory)
+
     if not jquery_url:
         jquery_symlink = os.path.join(directory, "jquery.js")
         if os.path.exists(jquery_symlink):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list