mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +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
8
setup.py
8
setup.py
|
@ -8,7 +8,7 @@ import os
|
|||
import re
|
||||
import sys
|
||||
import sysconfig
|
||||
from glob import glob
|
||||
from glob import glob, escape
|
||||
|
||||
|
||||
try:
|
||||
|
@ -401,7 +401,7 @@ class PyBuildExt(build_ext):
|
|||
|
||||
# Python header files
|
||||
headers = [sysconfig.get_config_h_filename()]
|
||||
headers += glob(os.path.join(sysconfig.get_path('include'), "*.h"))
|
||||
headers += glob(os.path.join(escape(sysconfig.get_path('include')), "*.h"))
|
||||
|
||||
for ext in self.extensions:
|
||||
ext.sources = [ find_module_file(filename, moddirlist)
|
||||
|
@ -2433,7 +2433,7 @@ class PyBuildExt(build_ext):
|
|||
|
||||
if "blake2" in configured:
|
||||
blake2_deps = glob(
|
||||
os.path.join(self.srcdir, 'Modules/_blake2/impl/*')
|
||||
os.path.join(escape(self.srcdir), 'Modules/_blake2/impl/*')
|
||||
)
|
||||
blake2_deps.append('hashlib.h')
|
||||
self.add(Extension(
|
||||
|
@ -2448,7 +2448,7 @@ class PyBuildExt(build_ext):
|
|||
|
||||
if "sha3" in configured:
|
||||
sha3_deps = glob(
|
||||
os.path.join(self.srcdir, 'Modules/_sha3/kcp/*')
|
||||
os.path.join(escape(self.srcdir), 'Modules/_sha3/kcp/*')
|
||||
)
|
||||
sha3_deps.append('hashlib.h')
|
||||
self.add(Extension(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue