Permalink
Browse files

Using errno.EEXIST rather than a literal 17 -- more compatibility.

  • Loading branch information...
1 parent 528efab commit 3bffac22a4b8ac00a8462371ed43b1ceb4aee59c Max Noel committed Feb 26, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 bin/dynamodb_dump
View
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import argparse
+import errno
import os
import boto
@@ -52,8 +53,8 @@ def dynamodb_dump(tables, out_dir):
try:
os.makedirs(out_dir)
except OSError as e:
- # Error 17 is "file exists", which we don't care about
- if e.errno != 17:
+ # We don't care if the dir already exists.
+ if e.errno != errno.EEXIST:
raise
conn = boto.connect_dynamodb()

0 comments on commit 3bffac2

Please sign in to comment.