File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -484,6 +484,12 @@ def _expand_patterns(cls, patterns: list[str]) -> Iterator[str]:
484484 ['LICENSE']
485485 >>> list(Distribution._expand_patterns(['pyproject.toml', 'LIC*']))
486486 ['pyproject.toml', 'LICENSE']
487+ >>> list(Distribution._expand_patterns(['setuptools/**/pyprojecttoml.py']))
488+ ['setuptools/config/pyprojecttoml.py']
489+ >>> list(Distribution._expand_patterns(['../LICENSE']))
490+ Traceback (most recent call last):
491+ ...
492+ setuptools.errors.InvalidConfigError: Pattern '../LICENSE' cannot contain '..'
487493 """
488494 return (
489495 path .replace (os .sep , "/" )
@@ -494,14 +500,6 @@ def _expand_patterns(cls, patterns: list[str]) -> Iterator[str]:
494500
495501 @staticmethod
496502 def _find_pattern (pattern : str ) -> Iterator [str ]:
497- """
498- >>> list(Distribution._find_pattern("setuptools/**/pyprojecttoml.py"))
499- ['setuptools/config/pyprojecttoml.py']
500- >>> list(Distribution._find_pattern("../LICENSE"))
501- Traceback (most recent call last):
502- ...
503- setuptools.errors.InvalidConfigError: Pattern '../LICENSE' cannot contain '..'
504- """
505503 if ".." in pattern : # XXX: Any other invalid character?
506504 raise InvalidConfigError (f"Pattern { pattern !r} cannot contain '..'" )
507505 return iglob (pattern , recursive = True )
You can’t perform that action at this time.
0 commit comments