Raise ValueError when HTML file already exists.

This commit is contained in:
Bastian Kleineidam 2013-02-07 20:48:03 +01:00
parent 1a0cd1ee6b
commit 419ae5fbcf

View file

@ -108,7 +108,8 @@ class HtmlEventHandler(EventHandler):
tomorrow = time.localtime(tomorrow) tomorrow = time.localtime(tomorrow)
fn = self.fnFromDate(today) fn = self.fnFromDate(today)
assert not os.path.exists(fn), 'Comic page for today already exists!' if os.path.exists(fn):
raise ValueError('output file %r already exists' % fn)
d = os.path.dirname(fn) d = os.path.dirname(fn)
if not os.path.isdir(d): if not os.path.isdir(d):