removing useless package
This commit is contained in:
parent
23f35535a3
commit
28f2e1da89
1 changed files with 2 additions and 3 deletions
|
@ -1,10 +1,9 @@
|
||||||
import sqlite3
|
import sqlite3
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
class Database:
|
class Database:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
path = Path("src/db/bot.sqlite3").absolute()
|
path = "src/db/bot.sqlite3"
|
||||||
if not self.isDatabaseExists(path):
|
if not self.isDatabaseExists(path):
|
||||||
self.createDB(path)
|
self.createDB(path)
|
||||||
self.con = sqlite3.connect(path)
|
self.con = sqlite3.connect(path)
|
||||||
|
@ -12,7 +11,7 @@ class Database:
|
||||||
|
|
||||||
def isDatabaseExists(self, path):
|
def isDatabaseExists(self, path):
|
||||||
try:
|
try:
|
||||||
Path(path).resolve(strict = True)
|
open(path, "r")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
|
Reference in a new issue