File tree 2 files changed +7
-13
lines changed
2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -258,10 +258,7 @@ def _parse_param_list(self, content):
258
258
r"`(?P<name>(?:~\w+\.)?[a-zA-Z0-9_.-]+)`|"
259
259
r" (?P<name2>[a-zA-Z0-9_.-]+))\s*" , re .X )
260
260
261
- if sys .version_info [0 ] >= 3 :
262
- zerowidthspace = '\u200B '
263
- else :
264
- zerowidthspace = '\xE2 \x80 \x8B '
261
+ empty_description = '..'
265
262
266
263
def _parse_see_also (self , content ):
267
264
"""
@@ -497,7 +494,7 @@ def _str_see_also(self, func_role):
497
494
last_had_desc = True
498
495
else :
499
496
last_had_desc = False
500
- out += self ._str_indent ([self .zerowidthspace ])
497
+ out += self ._str_indent ([self .empty_description ])
501
498
502
499
if last_had_desc :
503
500
out += ['' ]
Original file line number Diff line number Diff line change @@ -331,18 +331,15 @@ def _strip_blank_lines(s):
331
331
332
332
333
333
def line_by_line_compare (a , b ):
334
- if sys .version_info .major >= 3 :
335
- zerowidthspace = '\u200B '
336
- else :
337
- zerowidthspace = '\xE2 \x80 \x8B '
334
+ empty_description = '..'
335
+ rgx = re .compile (r"^\s+" + re .escape (empty_description ) + "$" )
338
336
339
- a = textwrap .dedent (a ). replace ( zerowidthspace , '' )
337
+ a = textwrap .dedent (a )
340
338
b = textwrap .dedent (b )
341
- a = [l .rstrip () for l in _strip_blank_lines (a ).split ('\n ' )]
342
- b = [l .rstrip () for l in _strip_blank_lines (b ).split ('\n ' )]
339
+ a = [rgx . sub ( '' , l .rstrip () ) for l in _strip_blank_lines (a ).split ('\n ' )]
340
+ b = [rgx . sub ( '' , l .rstrip () ) for l in _strip_blank_lines (b ).split ('\n ' )]
343
341
assert all (x == y for x , y in zip (a , b ))
344
342
345
-
346
343
def test_str ():
347
344
# doc_txt has the order of Notes and See Also sections flipped.
348
345
# This should be handled automatically, and so, one thing this test does
You can’t perform that action at this time.
0 commit comments