xref: /freebsd/contrib/libucl/python/tests/compat.py (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1try:
2     import unittest2 as unittest
3except ImportError:
4     import unittest
5
6# Python 2.7 - 3.1
7if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
8    unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp
9