diff options
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-x | swiftclient/shell.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index ff5b2be..9ca28b1 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -1942,9 +1942,14 @@ Examples: parser.usage = globals()['st_%s_help' % args[0]] if options['insecure']: import requests - from requests.packages.urllib3.exceptions import \ - InsecureRequestWarning - requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + try: + from requests.packages.urllib3.exceptions import \ + InsecureRequestWarning + except ImportError: + pass + else: + requests.packages.urllib3.disable_warnings( + InsecureRequestWarning) try: globals()['st_%s' % args[0]](parser, argv[1:], output) except ClientException as err: |