Skip to content

Commit a083527

Browse files
author
Mohan Kishore
committed
Changed the botocore import
1 parent 1ef9ff9 commit a083527

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python_dynamodb_lock/python_dynamodb_lock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55
module comment
66
"""
7-
import botocore
7+
from botocore.exceptions import ClientError
88
import datetime
99
import socket
1010
import time
@@ -107,7 +107,7 @@ def send_heartbeat(self, lock):
107107
# attribute_exists(#pk) AND attribute_exists(#sk) AND #rvn = :rvn AND #on = :on
108108
# attribute-names
109109
# attribute-values
110-
except botocore.exceptions.ClientError as e:
110+
except ClientError as e:
111111
if e.response['Error']['Code'] == 'ConditionalCheckFailedException':
112112
# TODO: need to handle the case where the lock was "stolen" by someone else...
113113
print
@@ -155,7 +155,7 @@ def release_lock(self,
155155
# attribute_exists(#pk) AND attribute_exists(#sk) AND #rvn = :rvn AND #on = :on
156156
# attribute-names
157157
# attribute-values
158-
except botocore.exceptions.ClientError as e:
158+
except ClientError as e:
159159
if e.response['Error']['Code'] == 'ConditionalCheckFailedException':
160160
# TODO: need to handle the case where the lock was "stolen" by someone else...
161161
print

0 commit comments

Comments
 (0)