File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
source_py3/python_toolbox Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1717
1818def _get_next_name (path ):
1919 assert isinstance (path , pathlib .Path )
20- parent = path .parent
2120 suffix = path .suffix
2221 suffixless_name = path .name [:- len (suffix )]
23- assert '{}{}{}' .format (parent , suffixless_name , suffix ) == path
22+ parent_with_separator = str (path )[:- len (path .name )]
23+ assert pathlib .Path ('{}{}{}' .format (parent_with_separator ,
24+ suffixless_name , suffix )) == path
2425 match = numbered_name_pattern .match (suffixless_name )
2526 if match :
2627 fixed_suffixless_name = '{} ({})' .format (
@@ -29,9 +30,8 @@ def _get_next_name(path):
2930 )
3031 else :
3132 fixed_suffixless_name = '{} (1)' .format (suffixless_name ,)
32- fix
3333 return pathlib .Path (
34- '{}{}{}' .format (parent , suffixless_name , suffix )
34+ '{}{}{}' .format (parent_with_separator , fixed_suffixless_name , suffix )
3535 )
3636
3737
You can’t perform that action at this time.
0 commit comments