summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-07-02 10:05:35 +0300
committerGitHub <noreply@github.com>2020-07-02 10:05:35 +0300
commite73896241e55f452656fd8070eb79f344091bca0 (patch)
tree5ce7fe2022e0ce1d481347ee49dab9d5580fb501 /setup.py
parentcbdacb94c1a096387e1fb37d4e44bb3847d0c4f8 (diff)
downloadcpython-git-e73896241e55f452656fd8070eb79f344091bca0.tar.gz
[3.8] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21277)
(cherry picked from commit 935586845815f5b4c7814794413f6a812d4bd45f)
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index b168ed4082..6340669fff 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ import os
import re
import sys
import sysconfig
-from glob import glob
+from glob import glob, escape
from distutils import log
from distutils.command.build_ext import build_ext
@@ -339,7 +339,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"))
# The sysconfig variables built by makesetup that list the already
# built modules and the disabled modules as configured by the Setup
@@ -2256,7 +2256,7 @@ class PyBuildExt(build_ext):
self.add(Extension('_sha1', ['sha1module.c'],
depends=['hashlib.h']))
- blake2_deps = glob(os.path.join(self.srcdir,
+ blake2_deps = glob(os.path.join(escape(self.srcdir),
'Modules/_blake2/impl/*'))
blake2_deps.append('hashlib.h')
@@ -2266,7 +2266,7 @@ class PyBuildExt(build_ext):
'_blake2/blake2s_impl.c'],
depends=blake2_deps))
- sha3_deps = glob(os.path.join(self.srcdir,
+ sha3_deps = glob(os.path.join(escape(self.srcdir),
'Modules/_sha3/kcp/*'))
sha3_deps.append('hashlib.h')
self.add(Extension('_sha3',