replace sys.exit with raise ImportError (closes: #84159)

authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
changesetd3c1fa91e736
branchstable
phasepublic
hiddenno
parent revision#754c49d1198e Added tag logilab-common-debian-version-0.57.1-1 for changeset fc3825ab0ba4
child revision#9a63ee5061b0 fix license in README
files modified by this revision
testlib.py
# HG changeset patch
# User Alexandre Fayolle <alexandre.fayolle@logilab.fr>
# Date 1323344407 -3600
# Thu Dec 08 12:40:07 2011 +0100
# Branch stable
# Node ID d3c1fa91e73609d39d9fffa7a5559f475f0c9307
# Parent 754c49d1198e19cdade5f551f4fa850ed4d28103
replace sys.exit with raise ImportError (closes: #84159)

diff --git a/testlib.py b/testlib.py
@@ -60,11 +60,11 @@
1  if not getattr(unittest_legacy, "__package__", None):
2      try:
3          import unittest2 as unittest
4          from unittest2 import SkipTest
5      except ImportError:
6 -        sys.exit("You have to install python-unittest2 to use this module")
7 +        raise ImportError("You have to install python-unittest2 to use %s" % __name__)
8  else:
9      import unittest
10      from unittest import SkipTest
11 
12  try: