def _attrs_to_jsdict(self, attrs, jsdict):
        """Write attribute values to a JSON object dict."""
        for attr in attrs:
            try:
                name, cls = attr.name, attr.cls
            except AttributeError:
                # Make troubleshooting easier by providing the attr.
                raise JsonableError("error processing attribute: %r" % attr)
            # TODO: handle and test None/JS_NULL.
            try:
                value = getattr(self, name)
            except TypeError:
                # Make troubleshooting easier by providing the name.
                raise JsonableError(name % "error getting attribute: %r")
            if value is None:
                # Don't write None values into the JSON object.
                continue
            jsobj = to_jsobj(value)
            jsdict[name] = jsobj
dataset/ETHPy150Open cjerdonek/open-rcv/openrcv/jsonlib.py/JsonableMixin._attrs_to_jsdict/swapped operands of `%`