diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-07-02 07:05:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 07:05:16 (GMT) |
commit | ecfecc2d6ce88ae71c783f0465a508c6a1b2f2b6 (patch) | |
tree | 15fe925d7c2eed5f56154f68971a5883870d5841 /setup.py | |
parent | df59293bf0d815fe37743025d639a63a78e0c771 (diff) | |
download | cpython-ecfecc2d6ce88ae71c783f0465a508c6a1b2f2b6.zip cpython-ecfecc2d6ce88ae71c783f0465a508c6a1b2f2b6.tar.gz cpython-ecfecc2d6ce88ae71c783f0465a508c6a1b2f2b6.tar.bz2 |
[3.9] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21275)
(cherry picked from commit 935586845815f5b4c7814794413f6a812d4bd45f)
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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( |