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

@@ -233,7 +233,7 @@ def run(input, conf, filepath=None):
if conf.is_file_ignored(filepath):
return ()
if isinstance(input, (type(b''), type(u''))): # compat with Python 2 & 3
if isinstance(input, (bytes, str)):
return _run(input, conf, filepath)
elif hasattr(input, 'read'): # Python 2's file or Python 3's io.IOBase
# We need to have everything in memory to parse correctly

View File

@@ -17,10 +17,6 @@
"""
Use this rule to set a limit to lines length.
Note: with Python 2, the ``line-length`` rule may not work properly with
unicode characters because of the way strings are represented in bytes. We
recommend running yamllint with Python 3.
.. rubric:: Options
* ``max`` defines the maximal (inclusive) length of lines.