Skip to content

Commit 574885f

Browse files
committed
catch deprecation warnings
1 parent ef80dc3 commit 574885f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pythainlp/corpus/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,15 @@ def remove(name: str) -> bool:
282282
db = TinyDB(corpus_db_path())
283283
query = Query()
284284
data = db.search(query.name == name)
285-
db.close()
286285

287286
if data:
288287
path = get_corpus_path(name)
289288
os.remove(path)
290289
db.remove(query.name == name)
290+
db.close()
291291
return True
292292

293+
db.close()
293294
return False
294295

295296

0 commit comments

Comments
 (0)