# Buggy code
def match(self, node):
    # type: (nodes.Node) -> bool
    try:
        if self.classes and not isinstance(node, self.classes):
            return False

        for key, value in self.attrs.items():
            if key not in node:
                return False
            elif value is Any:
                continue
            elif node.get(key) != value:
                return False
        else:
            return True
    except Exception:
        # for non-Element nodes
        return False


# Traceback (AttributeError)
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/cmd/build.py", line 288, in build_main
app.build(args.force_all, filenames)
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/application.py", line 339, in build
self.builder.build_update()
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 327, in build_update
len(to_build))
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 340, in build
updated_docnames = set(self.read())
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 448, in read
self._read_serial(docnames)
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 470, in _read_serial
self.read_doc(docname)
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/builders/__init__.py", line 514, in read_doc
doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/io.py", line 318, in read_doc
pub.publish()
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/envs/latest/lib/python3.5/site-packages/docutils/core.py", line 218, in publish
self.apply_transforms()
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/envs/latest/lib/python3.5/site-packages/docutils/core.py", line 199, in apply_transforms
self.document.transformer.apply_transforms()
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/transforms/__init__.py", line 90, in apply_transforms
Transformer.apply_transforms(self)
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/envs/latest/lib/python3.5/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
transform.apply(**kwargs)
File "/home/docs/checkouts/readthedocs.org/user_builds/sphinx-ja/checkouts/latest/sphinx/sphinx/transforms/i18n.py", line 465, in apply
node.delattr('translated')
AttributeError: 'Text' object has no attribute 'delattr'

# Fixed code
def match(self, node):
    # type: (nodes.Node) -> bool
    try:
        if self.classes and not isinstance(node, self.classes):
            return False

        if self.attrs and isinstance(node, nodes.Text):
            return False

        for key, value in self.attrs.items():
            if key not in node:
                return False
            elif value is Any:
                continue
            elif node.get(key) != value:
                return False
        else:
            return True
    except Exception:
        # for non-Element nodes
        return False