freebsd-dev/contrib/libucl/python/tests/compat.py
2016-10-01 00:14:01 +00:00

9 lines
239 B
Python

try:
import unittest2 as unittest
except ImportError:
import unittest
# Python 2.7 - 3.1
if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
unittest.TestCase.assertRaisesRegex = unittest.TestCase.assertRaisesRegexp