Skip to content

Commit 2b01ebf

Browse files
author
Frederick Ross
committed
Fixed an error in the export example.
Eddie Satterly found that when you run it twice without telling it to recover, it doesn't die when it should throw an error about not recovering and not overwriting, but that gets clobbered by a later error where open mode didn't get set properly.
1 parent b33b546 commit 2b01ebf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/export/export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def main():
329329

330330
if path.exists(options.kwargs['output']):
331331
if options.kwargs['recover'] == False:
332-
error("Export file exists, and recover option nor specified")
332+
error("Export file %s exists, and recover option nor specified" % options.kwargs['output'], exitcode=1)
333333
else:
334334
options.kwargs['end'] = recover(options)
335335
options.kwargs['fixtail'] = True

utils/cmdopts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Print the given message to stderr, and optionally exit
2424
def error(message, exitcode = None):
2525
print >> sys.stderr, "Error: %s" % message
26-
if not exitcode is None: sys.exit(exitcode)
26+
if exitcode is not None: sys.exit(exitcode)
2727

2828
class record(dict):
2929
def __getattr__(self, name):

0 commit comments

Comments
 (0)