File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -145,8 +145,11 @@ def test_pep561(testcase: DataDrivenTestCase) -> None:
145145 output .append (line [len (test_temp_dir + os .sep ) :].rstrip ("\r \n " ))
146146 else :
147147 # Normalize paths so that the output is the same on Windows and Linux/macOS.
148- line = line .replace (test_temp_dir + os .sep , test_temp_dir + "/" )
149- output .append (line .rstrip ("\r \n " ))
148+ # Yes, this is naive: replace all slashes preceding first colon, if any.
149+ path , * rest = line .split (":" , maxsplit = 1 )
150+ if rest :
151+ path = path .replace (os .sep , "/" )
152+ output .append (":" .join ([path , * rest ]).rstrip ("\r \n " ))
150153 iter_count = "" if i == 0 else f" on iteration { i + 1 } "
151154 expected = testcase .output if i == 0 else testcase .output2 .get (i + 1 , [])
152155
You can’t perform that action at this time.
0 commit comments