xref: /freebsd/contrib/libucl/python/tests/compat.py (revision a90b9d0159070121c221b966469c3e36d912bf82)
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