Skip to content

Commit

Permalink
Only catch exception in main() when told to.
Browse files Browse the repository at this point in the history
  • Loading branch information
whart222 committed Mar 23, 2013
1 parent 46bd30d commit 34a744f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions python/cxxtest/cxxtestgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
lastIncluded = ''


def main(args=sys.argv):
def main(args=sys.argv, catch=False):
'''The main program'''
#
# Reset global state
Expand All @@ -69,7 +69,8 @@ def main(args=sys.argv):
[options,suites] = cxxtest_parser.scanInputFiles( files, options )
writeOutput()
except SystemExit:
pass
if not catch:
raise

def create_parser(asciidoc=False):
parser = OptionParser("cxxtestgen [options] [<filename> ...]")
Expand Down
5 changes: 3 additions & 2 deletions python/python3/cxxtest/cxxtestgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
lastIncluded = ''


def main(args=sys.argv):
def main(args=sys.argv, catch=False):
'''The main program'''
#
# Reset global state
Expand All @@ -69,7 +69,8 @@ def main(args=sys.argv):
[options,suites] = cxxtest_parser.scanInputFiles( files, options )
writeOutput()
except SystemExit:
pass
if not catch:
raise

def create_parser(asciidoc=False):
parser = OptionParser("cxxtestgen [options] [<filename> ...]")
Expand Down

0 comments on commit 34a744f

Please sign in to comment.