third_party.pylibs.pylint.src/pylint/testutils/tokenize_str.py
2020-11-29 11:59:49 +01:00

10 lines
283 B
Python

# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/master/COPYING
import tokenize
from io import StringIO
def _tokenize_str(code):
return list(tokenize.generate_tokens(StringIO(code).readline))