Skip to content

Commit e8af8b3

Browse files
committed
Use cross-platform home directory path
1 parent c56c9fa commit e8af8b3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docker/utils/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def exclude_paths(root, patterns, dockerfile=None):
114114
components = p.split('/')
115115
paths += [
116116
'/'.join(components[:end])
117-
for end in range(1, len(components)+1)
117+
for end in range(1, len(components) + 1)
118118
]
119119

120120
return set(paths)
@@ -369,8 +369,7 @@ def kwargs_from_env(ssl_version=None, assert_hostname=None):
369369
if tls_verify else host)
370370

371371
if tls_verify and not cert_path:
372-
if 'HOME' in os.environ:
373-
cert_path = os.path.join(os.environ['HOME'], '.docker')
372+
cert_path = os.path.join(os.path.expanduser('~'), '.docker')
374373

375374
if tls_verify and cert_path:
376375
params['tls'] = tls.TLSConfig(

0 commit comments

Comments
 (0)