summaryrefslogtreecommitdiff
path: root/setuptools/command
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-02-01 20:13:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2022-02-01 20:13:22 -0500
commita3bc3d44fb0ad669d75e674218078752de7bb24d (patch)
tree3370711aa74efe53bc58e9967ff3507803b33d07 /setuptools/command
parent9c4ed1a5970397812e0988f3d45a513f1bd9442a (diff)
downloadpython-setuptools-git-a3bc3d44fb0ad669d75e674218078752de7bb24d.tar.gz
Create a function for only_strs to help document its purpose.
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/easy_install.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index bdacbbfc..ef1a9b23 100644
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1334,9 +1334,7 @@ class easy_install(Command):
if not self.user:
return
home = convert_path(os.path.expanduser("~"))
- for path in self.config_vars.values():
- if not isinstance(path, str):
- continue
+ for path in only_strs(self.config_vars.values()):
if path.startswith(home) and not os.path.isdir(path):
self.debug_print("os.makedirs('%s', 0o700)" % path)
os.makedirs(path, 0o700)
@@ -2306,6 +2304,13 @@ def current_umask():
return tmp
+def only_strs(values):
+ """
+ Exclude non-str values. Ref #3063.
+ """
+ return filter(lambda val: isinstance(val, str), values)
+
+
class EasyInstallDeprecationWarning(SetuptoolsDeprecationWarning):
"""
Warning for EasyInstall deprecations, bypassing suppression.