boto.py 494 B

123456789101112131415161718192021
  1. """Boto/botocore helpers"""
  2. from __future__ import absolute_import
  3. import six
  4. from scrapy.exceptions import NotConfigured
  5. def is_botocore():
  6. try:
  7. import botocore
  8. return True
  9. except ImportError:
  10. if six.PY2:
  11. try:
  12. import boto
  13. return False
  14. except ImportError:
  15. raise NotConfigured('missing botocore or boto library')
  16. else:
  17. raise NotConfigured('missing botocore library')