File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed
Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -117,12 +117,9 @@ def norm_and_check(source_tree: str, requested: str) -> str:
117117
118118 abs_source = os .path .abspath (source_tree )
119119 abs_requested = os .path .normpath (os .path .join (abs_source , requested ))
120- # We have to use commonprefix for Python 2.7 compatibility. So we
121- # normalise case to avoid problems because commonprefix is a character
122- # based comparison :-(
123120 norm_source = os .path .normcase (abs_source )
124121 norm_requested = os .path .normcase (abs_requested )
125- if os . path . commonprefix ([ norm_source , norm_requested ]) != norm_source :
122+ if not norm_requested . startswith ( norm_source + os . sep ) :
126123 raise ValueError ("paths must be inside source tree" )
127124
128125 return abs_requested
You can’t perform that action at this time.
0 commit comments