File: boto.py

package info (click to toggle)
python-scrapy 1.5.1-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,404 kB
  • sloc: python: 25,793; xml: 199; makefile: 95; sh: 33
file content (21 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Boto/botocore helpers"""

from __future__ import absolute_import
import six

from scrapy.exceptions import NotConfigured


def is_botocore():
    try:
        import botocore
        return True
    except ImportError:
        if six.PY2:
            try:
                import boto
                return False
            except ImportError:
                raise NotConfigured('missing botocore or boto library')
        else:
            raise NotConfigured('missing botocore library')