File tree 1 file changed +1
-2
lines changed
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],
974
974
assert fscache is not None # Since mypy doesn't know parser.error() raises.
975
975
# Do some stuff with drive letters to make Windows happy (esp. tests).
976
976
current_drive , _ = os .path .splitdrive (os .getcwd ())
977
- dotdotslash = os .pardir + os .sep
978
977
package_root = []
979
978
for root in options .package_root :
980
979
if os .path .isabs (root ):
@@ -985,7 +984,7 @@ def process_package_roots(fscache: Optional[FileSystemCache],
985
984
# Empty package root is always okay.
986
985
if not root :
987
986
root = os .curdir
988
- if os .path .relpath (root ).startswith ( dotdotslash ) :
987
+ if os .path .relpath (root ).split ( os . sep )[ 0 ] == os . pardir :
989
988
parser .error ("Package root cannot be above current directory: %r" % root )
990
989
root = os .path .normpath (os .path .abspath (root ))
991
990
if not root .endswith (os .sep ):
You can’t perform that action at this time.
0 commit comments