# Buggy code
def __init__(self, buffers: List[str]) -> None:
    lines = iter(buffers)
    self.buffers = buffers
    self.tokens = tokenize.generate_tokens(lambda: next(lines))
    self.current = None  # type: Token
    self.previous = None  # type: Token


# Traceback (AttributeError)
# Sphinx version: 2.2.1
# Python version: 3.8.0 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.10.3
# Last messages:
#
#   looking for now-outdated files...
#   none found
#   pickling environment...
#   done
#   checking consistency...
#   done
#   preparing documents...
#   done
#   writing output... [ 11%] configuring/index
# Loaded extensions:
#   sphinx.ext.mathjax (2.2.1) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/ext/mathjax.py
#   sphinxcontrib.applehelp (1.0.1) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinxcontrib/applehelp/__init__.py
#   sphinxcontrib.devhelp (1.0.1) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinxcontrib/devhelp/__init__.py
#   sphinxcontrib.htmlhelp (1.0.2) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinxcontrib/htmlhelp/__init__.py
#   sphinxcontrib.serializinghtml (1.1.3) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinxcontrib/serializinghtml/__init__.py
#   sphinxcontrib.qthelp (1.0.2) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinxcontrib/qthelp/__init__.py
#   alabaster (0.7.12) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/alabaster/__init__.py
#   sphinx.ext.autodoc (2.2.1) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/ext/autodoc/__init__.py
#   sphinx.ext.intersphinx (2.2.1) from /Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/ext/intersphinx.py
Traceback (most recent call last):
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/cmd/build.py", line 276, in build_main
app.build(args.force_all, filenames)
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/application.py", line 346, in build
self.builder.build_update()
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 297, in build_update
self.build(to_build,
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 361, in build
self.write(docnames, list(updated_docnames), method)
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 532, in write
self._write_parallel(sorted(docnames),
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 572, in _write_parallel
tasks.add_task(write_process, arg)
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/util/parallel.py", line 96, in add_task
self._join_one()
File "/Users/ssbarnea/os/ansible-lint/.tox/docs/lib/python3.8/site-packages/sphinx/util/parallel.py", line 120, in _join_one
self._procs[newtid].start()
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
return Popen(process_obj)
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/Users/ssbarnea/.pyenv/versions/3.8.0/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'ParallelTasks.add_task.<locals>.<lambda>'

# Fixed code
def __init__(self, buffers: List[str]) -> None:
    lines = iter(buffers)
    self.buffers = buffers
    self.tokens = tokenize.generate_tokens(lambda: next(lines))  # type: ignore
    self.current = None  # type: Token
    self.previous = None  # type: Token