File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -239,16 +239,17 @@ def _parse_atom_entry(entry):
239239 content = record ((k , v ) for k , v in content .iteritems ()
240240 if k not in ['eai:acl' , 'eai:attributes' ])
241241
242- if isinstance (content ['type' ], list ):
243- content ['type' ] = [t for t in content ['type' ] if t != 'text/xml' ]
244- # Unset type if it was only 'text/xml'
245- if len (content ['type' ]) == 0 :
242+ if 'type' in content :
243+ if isinstance (content ['type' ], list ):
244+ content ['type' ] = [t for t in content ['type' ] if t != 'text/xml' ]
245+ # Unset type if it was only 'text/xml'
246+ if len (content ['type' ]) == 0 :
247+ content .pop ('type' , None )
248+ # Flatten 1 element list
249+ if len (content ['type' ]) == 1 :
250+ content ['type' ] = content ['type' ][0 ]
251+ else :
246252 content .pop ('type' , None )
247- # Flatten 1 element list
248- if len (content ['type' ]) == 1 :
249- content ['type' ] = content ['type' ][0 ]
250- else :
251- content .pop ('type' , None )
252253
253254 return record ({
254255 'title' : title ,
You can’t perform that action at this time.
0 commit comments