File tree Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Expand file tree Collapse file tree 2 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -251,10 +251,7 @@ def _parse_param_list(self, content):
251251 r"`(?P<name>(?:~\w+\.)?[a-zA-Z0-9_.-]+)`|"
252252 r" (?P<name2>[a-zA-Z0-9_.-]+))\s*" , re .X )
253253
254- if sys .version_info [0 ] >= 3 :
255- zerowidthspace = '\u200B '
256- else :
257- zerowidthspace = '\xE2 \x80 \x8B '
254+ empty_description = '..'
258255
259256 def _parse_see_also (self , content ):
260257 """
@@ -489,7 +486,7 @@ def _str_see_also(self, func_role):
489486 last_had_desc = True
490487 else :
491488 last_had_desc = False
492- out += self ._str_indent ([self .zerowidthspace ])
489+ out += self ._str_indent ([self .empty_description ])
493490
494491 if last_had_desc :
495492 out += ['' ]
Original file line number Diff line number Diff line change @@ -332,15 +332,13 @@ def _strip_blank_lines(s):
332332
333333
334334def line_by_line_compare (a , b ):
335- if sys .version_info .major >= 3 :
336- zerowidthspace = '\u200B '
337- else :
338- zerowidthspace = '\xE2 \x80 \x8B '
335+ empty_description = '..'
336+ rgx = re .compile (r"^\s+" + re .escape (empty_description ) + "$" )
339337
340- a = textwrap .dedent (a ). replace ( zerowidthspace , '' )
338+ a = textwrap .dedent (a )
341339 b = textwrap .dedent (b )
342- a = [l .rstrip () for l in _strip_blank_lines (a ).split ('\n ' )]
343- b = [l .rstrip () for l in _strip_blank_lines (b ).split ('\n ' )]
340+ a = [rgx . sub ( '' , l .rstrip () ) for l in _strip_blank_lines (a ).split ('\n ' )]
341+ b = [rgx . sub ( '' , l .rstrip () ) for l in _strip_blank_lines (b ).split ('\n ' )]
344342 assert_list_equal (a , b )
345343
346344
You can’t perform that action at this time.
0 commit comments