Browse code

Merge branch 'master' of https://github.com/s3tools/s3cmd

Taras Postument authored on 2018/05/07 23:15:51
Showing 2 changed files
... ...
@@ -789,6 +789,7 @@ class S3(object):
789 789
             'x-amz-delete-marker',
790 790
             # other headers returned from object_info() we don't want to send
791 791
             'accept-ranges',
792
+            'connection',
792 793
             'etag',
793 794
             'server',
794 795
             'x-amz-id-2',
... ...
@@ -57,7 +57,12 @@ import tempfile
57 57
 from copy import copy
58 58
 from optparse import OptionParser, Option, OptionValueError, IndentedHelpFormatter
59 59
 from logging import debug, info, warning, error
60
-from distutils.spawn import find_executable
60
+
61
+try:
62
+    from shutil import which
63
+except ImportError:
64
+    # python2 fallback code
65
+    from distutils.spawn import find_executable as which
61 66
 
62 67
 from ssl import SSLError
63 68
 import io
... ...
@@ -2274,7 +2279,7 @@ def run_configure(config_file, args):
2274 2274
         ]
2275 2275
     ## Option-specfic defaults
2276 2276
     if getattr(cfg, "gpg_command") == "":
2277
-        setattr(cfg, "gpg_command", find_executable("gpg"))
2277
+        setattr(cfg, "gpg_command", which("gpg"))
2278 2278
 
2279 2279
     if getattr(cfg, "proxy_host") == "" and os.getenv("http_proxy"):
2280 2280
         autodetected_encoding = locale.getpreferredencoding() or "UTF-8"