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