diff options
| author | leonoverweel <l.overweel@gmail.com> | 2017-03-27 17:00:39 +0200 |
|---|---|---|
| committer | leonoverweel <l.overweel@gmail.com> | 2017-03-27 17:00:39 +0200 |
| commit | 35a7c871045c2d77ee64358f8058a35d3929a0fa (patch) | |
| tree | 8aed88af8cd812becb58b09bfcb4e060a98cfa63 /database | |
| parent | 3e03beb7d1cd48ae9d0786af5db4c5556b4c4e3b (diff) | |
Only remove database if it exists in rebuild
Diffstat (limited to 'database')
| -rw-r--r-- | database/rebuild-database.py | 5 |
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) |
