Commits

Georg Brandl committed f1c19a3

Fix handling of doc field types for different directive types.

  • Participants
  • Parent commits f56871c

Comments (0)

Files changed (3)

 * #490: Fix cross-references to objects of types added by the
   :func:`~.Sphinx.add_object_type` API function.
 
+* Fix handling of doc field types for different directive types.
+
 * Allow breaking long signatures, continuing with backlash-escaped
   newlines.
 

File sphinx/directives/__init__.py

             self.env.temp_data['object'] = self.names[0]
         self.before_content()
         self.state.nested_parse(self.content, self.content_offset, contentnode)
-        #self.handle_doc_fields(contentnode)
         DocFieldTransformer(self).transform_all(contentnode)
         self.env.temp_data['object'] = None
         self.after_content()

File sphinx/util/docfields.py

 
     def __init__(self, directive):
         self.domain = directive.domain
-        if not hasattr(directive, '_doc_field_type_map'):
+        if '_doc_field_type_map' not in directive.__class__.__dict__:
             directive.__class__._doc_field_type_map = \
                 self.preprocess_fieldtypes(directive.__class__.doc_field_types)
         self.typemap = directive._doc_field_type_map