End support for Python 2

As planned and advertized, yamllint drops support for Python 2 on 2021.
This commit is contained in:
Adrien Vergé
2021-01-05 08:20:57 +01:00
parent ee4d163ff8
commit a3fc64d134
9 changed files with 8 additions and 55 deletions

View File

@@ -14,10 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from io import StringIO
import fcntl
import locale
import os
@@ -71,11 +68,6 @@ class CommandLineTestCase(unittest.TestCase):
def setUpClass(cls):
super(CommandLineTestCase, cls).setUpClass()
# https://docs.python.org/3/library/unittest.html#deprecated-aliases
if sys.version_info < (3, 2):
cls.assertRegex = cls.assertRegexpMatches
cls.assertRaisesRegex = cls.assertRaisesRegexp
cls.wd = build_temp_workspace({
# .yaml file at root
'a.yaml': '---\n'