mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
[3.9] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21275)
(cherry picked from commit 9355868458
)
This commit is contained in:
parent
df59293bf0
commit
ecfecc2d6c
24 changed files with 40 additions and 30 deletions
|
@ -4259,7 +4259,7 @@ class _TestImportStar(unittest.TestCase):
|
|||
def get_module_names(self):
|
||||
import glob
|
||||
folder = os.path.dirname(multiprocessing.__file__)
|
||||
pattern = os.path.join(folder, '*.py')
|
||||
pattern = os.path.join(glob.escape(folder), '*.py')
|
||||
files = glob.glob(pattern)
|
||||
modules = [os.path.splitext(os.path.split(f)[1])[0] for f in files]
|
||||
modules = ['multiprocessing.' + m for m in modules]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue