File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -433,20 +433,29 @@ def get_property_docstring(self, prop_name):
433433
434434 doc = self .__doc__ .split ('\n ' )
435435
436- r = re .compile (" {} :" .format (prop_name ))
437- match = list (filter (r .match , doc ))
436+ r = " {} :" .format (prop_name )
438437
439- assert len (match ) > 0 , "No matches for {} documentation" .format (prop_name )
440- assert len (match ) == 1 , "Too many matches for {} documentation" .format (prop_name )
441- match = match [0 ]
438+ def find_match (str ):
439+ if r in str :
440+ return True
441+ else :
442+ return False
443+
444+ match = list (filter (find_match , doc ))
442445
446+ assert not len (match ) > 1 , "Too many matches for {} documentation" .format (prop_name )
447+
448+ if len (match ) == 0 :
449+ match = ''
450+ else :
451+ match = match [0 ]
443452 for i , string in enumerate (doc ):
444453 if string == match :
445454 break
446455
447456 doc_string = doc [i ][4 ::]
448457
449- for j in range (len (doc_string )):
458+ for j in range (len (doc )):
450459 try :
451460 doc [i + 1 + j ]
452461 except :
You can’t perform that action at this time.
0 commit comments