Skip to content

Commit b8f75b6

Browse files
max-ibragimowMax Ibragimov
andauthored
Fixed api after merging branches (#53)
Co-authored-by: Max Ibragimov <maxim.ibragimov@tantorlabs.ru>
1 parent 320b510 commit b8f75b6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

pg_anon/context.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import argparse
2+
import ast
23
import os
34
import re
45
from typing import Dict, Optional
@@ -179,12 +180,12 @@ def read_meta_dict(self):
179180
for meta_dict_file in dict_files_list:
180181
dictionary_file_name = os.path.join("dict", meta_dict_file)
181182
with open(os.path.join(self.current_dir, dictionary_file_name), "r") as dictionary_file:
182-
data = dictionary_file.read()
183+
data = dictionary_file.read().strip()
183184

184185
if not data:
185186
continue
186187

187-
meta_dict_data = eval(data)
188+
meta_dict_data = ast.literal_eval(data)
188189

189190
if not meta_dict_data:
190191
continue

pg_anon/pg_anon.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from pg_anon.version import __version__
2222

2323

24-
async def run_pg_anon(cli_run_params: Optional[List[str]] = None) -> None:
24+
async def run_pg_anon(cli_run_params: Optional[List[str]] = None) -> PgAnonResult:
2525
"""
2626
Run pg_anon
2727
:param cli_run_params: list of params in command line format
@@ -33,6 +33,8 @@ async def run_pg_anon(cli_run_params: Optional[List[str]] = None) -> None:
3333
if result.result_code == ResultCode.FAIL:
3434
sys.exit(1)
3535

36+
return result
37+
3638

3739
class MainRoutine:
3840

0 commit comments

Comments
 (0)