File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -974,7 +974,6 @@ def process_package_roots(fscache: Optional[FileSystemCache],
974974 assert fscache is not None # Since mypy doesn't know parser.error() raises.
975975 # Do some stuff with drive letters to make Windows happy (esp. tests).
976976 current_drive , _ = os .path .splitdrive (os .getcwd ())
977- dotdotslash = os .pardir + os .sep
978977 package_root = []
979978 for root in options .package_root :
980979 if os .path .isabs (root ):
@@ -985,7 +984,7 @@ def process_package_roots(fscache: Optional[FileSystemCache],
985984 # Empty package root is always okay.
986985 if not root :
987986 root = os .curdir
988- if os .path .relpath (root ).startswith ( dotdotslash ) :
987+ if os .path .relpath (root ).split ( os . sep )[ 0 ] == os . pardir :
989988 parser .error ("Package root cannot be above current directory: %r" % root )
990989 root = os .path .normpath (os .path .abspath (root ))
991990 if not root .endswith (os .sep ):
You can’t perform that action at this time.
0 commit comments