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