From 35a7c871045c2d77ee64358f8058a35d3929a0fa Mon Sep 17 00:00:00 2001 From: leonoverweel Date: Mon, 27 Mar 2017 17:00:39 +0200 Subject: Only remove database if it exists in rebuild --- database/rebuild-database.py | 5 +++-- 1 file 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) -- cgit v1.2.3