fix doc fragments (#33892)

* fix doc fragments

fixes #33864

* pop it
This commit is contained in:
Brian Coca 2017-12-14 16:06:47 -05:00 committed by GitHub
parent ff923fb6b0
commit 54e8e122bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,12 +56,13 @@ def merge_fragment(target, source):
value = sorted(frozenset(value + target[key]))
else:
raise Exception("Attempt to extend a documentation fragement, invalid type for %s" % key)
else:
target[key] = value
def add_fragments(doc, filename):
fragments = doc.get('extends_documentation_fragment', [])
fragments = doc.pop('extends_documentation_fragment', [])
if isinstance(fragments, string_types):
fragments = [fragments]