1212import re
1313from functools import total_ordering
1414import sys
15- from pathlib import PureWindowsPath
16- import os
1715
1816def get_renamer (filename ):
1917 layout = load (filename )
2018 def rename (path ):
2119 renamed = layout .artificial_path (path )
2220 return path if renamed is None else renamed
23- if os .name == "nt" :
24- return lambda path : rename (PureWindowsPath (path ).as_posix ())
2521 return rename
2622
2723def load (filename ):
@@ -261,7 +257,7 @@ def __init__(self, path, line, virtual=None):
261257 exclude = path
262258 self ._line = line ;
263259 self ._original = u'-' + exclude ;
264- if os . name != 'nt' and not exclude .startswith (u"/" ):
260+ if not exclude .startswith (u"/" ):
265261 exclude = u'/' + exclude
266262 if exclude .find (u"//" ) != - 1 :
267263 raise _error (u"Illegal '//' in exclude path" , line )
@@ -278,14 +274,14 @@ def __init__(self, path, line, virtual=None):
278274 include = path
279275 self ._line = line ;
280276 self ._original = include ;
281- if os . name != 'nt' and not include .startswith (u"/" ):
277+ if not include .startswith (u"/" ):
282278 include = u'/' + include
283279 doubleslash = include .find (u"//" )
284280 if doubleslash != include .find (u"//" ):
285281 raise _error (u"More than one '//' in include path (project-layout)" , line )
286282 if self ._verify_stars .match (include ):
287283 raise _error (u"Illegal use of '**' in include path (project-layout)" , line )
288- if os . name != 'nt' and not virtual .startswith (u"/" ):
284+ if not virtual .startswith (u"/" ):
289285 virtual = u"/" + virtual
290286 if virtual .endswith (u"/" ):
291287 virtual = virtual [0 : - 1 ]
0 commit comments