From 1ab58a01beda76cf9d3d8015e69a1b8ea46418ab Mon Sep 17 00:00:00 2001 From: "Gavin M. Roy" Date: Tue, 14 Jun 2016 12:18:34 -0400 Subject: [PATCH] Insert an exception stub for Python 2.7 --- sprockets/clients/dynamodb/connector.py | 7 +++++++ tests/api_tests.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/sprockets/clients/dynamodb/connector.py b/sprockets/clients/dynamodb/connector.py index be3fedf..d3acf8b 100644 --- a/sprockets/clients/dynamodb/connector.py +++ b/sprockets/clients/dynamodb/connector.py @@ -10,6 +10,13 @@ from tornado_aws import exceptions as aws_exceptions from . import utils from . import exceptions +# Stub ConnectionError for Python 2.7 that doesn't support it +try: + ConnectionError +except NameError: + class ConnectionError(Exception): + pass + LOGGER = logging.getLogger(__name__) diff --git a/tests/api_tests.py b/tests/api_tests.py index 930a60d..4a5fb9a 100644 --- a/tests/api_tests.py +++ b/tests/api_tests.py @@ -13,6 +13,13 @@ from tornado_aws import exceptions as aws_exceptions from sprockets.clients import dynamodb from sprockets.clients.dynamodb import exceptions +# Stub ConnectionError for Python 2.7 that doesn't support it +try: + ConnectionError +except NameError: + class ConnectionError(Exception): + pass + class AsyncTestCase(testing.AsyncTestCase):