summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--database/rebuild-database.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/database/rebuild-database.py b/database/rebuild-database.py
index 6e10b646..0cbeb27a 100644
--- a/database/rebuild-database.py
+++ b/database/rebuild-database.py
@@ -10,8 +10,9 @@ except:
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
db_location = os.path.join(BASE_DIR, 'opendc.db')
-print "Removing old database..."
-os.remove(db_location)
+if os.path.exists(db_location):
+ print "Removing old database..."
+ os.remove(db_location)
print "Connecting to new database..."
conn = sqlite3.connect(db_location)