Skip to content

Commit 9b6d5ab

Browse files
Fix type of __dict_2_obj anf codition of first config's element
1 parent 647de22 commit 9b6d5ab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

jsonconfigparser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __create_new_instace(cls,schema:dict, path_file:str):
2222

2323
try:
2424
config = Schema(schema).validate(json.loads(file_buff))
25-
if not isinstance(config, dict):
25+
if type(config) is not dict:
2626
raise ConfigException("The first config's element should be a Map")
2727
cls.__instance = cls.__dict_2_obj(config)
2828
except json.JSONDecodeError:
@@ -31,7 +31,7 @@ def __create_new_instace(cls,schema:dict, path_file:str):
3131
raise ConfigException(str(e))
3232

3333
@classmethod
34-
def __dict_2_obj(cls, data:dict):
34+
def __dict_2_obj(cls, data:any):
3535
_type = type(data)
3636

3737
if _type is dict:

0 commit comments

Comments
 (0)