@@ -67,13 +67,13 @@ def __init__(self):
6767 front_sep = r'\s|[*+-,<=(\[]'
6868 back_sep = front_sep + r'|[>j)\]}]'
6969
70- fbeg = r '^{}(?={}|$)'. format ( got_floats , back_sep )
71- fmidend = r '(?<={}){}(?={}|$)'. format ( front_sep , got_floats , back_sep )
72- self .num_got_rgx = re .compile (r '({}|{})'. format ( fbeg , fmidend ) )
70+ fbeg = fr '^{ got_floats } (?={ back_sep } |$)'
71+ fmidend = fr '(?<={ front_sep } ){ got_floats } (?={ back_sep } |$)'
72+ self .num_got_rgx = re .compile (fr '({ fbeg } |{ fmidend } )' )
7373
74- fbeg = r '^{}(?={}|$)'. format ( want_floats , back_sep )
75- fmidend = r '(?<={}){}(?={}|$)'. format ( front_sep , want_floats , back_sep )
76- self .num_want_rgx = re .compile (r '({}|{})'. format ( fbeg , fmidend ) )
74+ fbeg = fr '^{ want_floats } (?={ back_sep } |$)'
75+ fmidend = fr '(?<={ front_sep } ){ want_floats } (?={ back_sep } |$)'
76+ self .num_want_rgx = re .compile (fr '({ fbeg } |{ fmidend } )' )
7777
7878 # As of 2023-09-26, Python base class has no init, but just in case
7979 # it acquires one.
@@ -220,7 +220,7 @@ def normalize_floats(self, want, got, flags):
220220 # blank line, unless the DONT_ACCEPT_BLANKLINE flag is used.
221221 if not (flags & doctest .DONT_ACCEPT_BLANKLINE ):
222222 # Replace <BLANKLINE> in want with a blank line.
223- want = re .sub (r '(?m)^{}\s*?$' . format ( re .escape (doctest .BLANKLINE_MARKER )) ,
223+ want = re .sub (fr '(?m)^{ re .escape (doctest .BLANKLINE_MARKER )} \s*?$' ,
224224 '' , want )
225225 # If a line in got contains only spaces, then remove the
226226 # spaces.
0 commit comments