Skip to content

Commit e40ae61

Browse files
committed
minor fixing
1 parent e4e6d92 commit e40ae61

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

filexdb/document.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ def count_item(self) -> int:
7777

7878
return count
7979

80-
81-
8280
def export(self, _file_name, _file_dir=None, _mode="json"):
8381
"""
8482

filexdb/fileio.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def create_file(db_name: str, data_dir: str = None):
3737
pass
3838

3939

40-
def pre_process(ext: str, db_name: str, data_dir=None) -> tuple[str, str]:
40+
def pre_process(ext: str, db_name: str, data_dir=None):
4141
"""
4242
4343
:param ext:
@@ -311,6 +311,9 @@ def to_json(self, _data, _file_path) -> None:
311311
:param _file_path: Where to export.
312312
:return: None
313313
"""
314-
with open(_file_path, "w") as f:
315-
json.dump(_data, fp=f, indent=4)
314+
try:
315+
with open(_file_path, "w") as f:
316+
json.dump(_data, fp=f, indent=4)
316317

318+
except Exception as e:
319+
print(e)

0 commit comments

Comments
 (0)