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 @@ -473,6 +473,12 @@ def _expand_patterns(cls, patterns: list[str]) -> Iterator[str]:
473
473
['LICENSE']
474
474
>>> list(Distribution._expand_patterns(['pyproject.toml', 'LIC*']))
475
475
['pyproject.toml', 'LICENSE']
476
+ >>> list(Distribution._expand_patterns(['setuptools/**/pyprojecttoml.py']))
477
+ ['setuptools/config/pyprojecttoml.py']
478
+ >>> list(Distribution._expand_patterns(['../LICENSE']))
479
+ Traceback (most recent call last):
480
+ ...
481
+ setuptools.errors.InvalidConfigError: Pattern '../LICENSE' cannot contain '..'
476
482
"""
477
483
return (
478
484
path .replace (os .sep , "/" )
@@ -483,14 +489,6 @@ def _expand_patterns(cls, patterns: list[str]) -> Iterator[str]:
483
489
484
490
@staticmethod
485
491
def _find_pattern (pattern : str ) -> Iterator [str ]:
486
- """
487
- >>> list(Distribution._find_pattern("setuptools/**/pyprojecttoml.py"))
488
- ['setuptools/config/pyprojecttoml.py']
489
- >>> list(Distribution._find_pattern("../LICENSE"))
490
- Traceback (most recent call last):
491
- ...
492
- setuptools.errors.InvalidConfigError: Pattern '../LICENSE' cannot contain '..'
493
- """
494
492
if ".." in pattern : # XXX: Any other invalid character?
495
493
raise InvalidConfigError (f"Pattern { pattern !r} cannot contain '..'" )
496
494
return iglob (pattern , recursive = True )
You can’t perform that action at this time.
0 commit comments