A bug correction that could easily bite us in the butt

This commit is contained in:
Maximilien Rigaut 2022-05-19 05:59:32 +02:00
parent 3d4c134479
commit b60eedd2d2
1 changed files with 2 additions and 1 deletions

View File

@ -136,16 +136,17 @@ class PreParser:
) )
if e in self.global_dict_of_imports: if e in self.global_dict_of_imports:
pp = self.global_dict_of_imports[e] pp = self.global_dict_of_imports[e]
self.local_dict_of_imports[e] = pp
else: else:
try: try:
pp = PreParser(e, self.__env, self.list_of_paths.copy(), self.global_dict_of_imports) pp = PreParser(e, self.__env, self.list_of_paths.copy(), self.global_dict_of_imports)
self.global_dict_of_imports[e] = pp self.global_dict_of_imports[e] = pp
pp.make_import_list() pp.make_import_list()
self.local_dict_of_imports[e] = pp
except FileNotFoundError: except FileNotFoundError:
error_mngr.log_exception( error_mngr.log_exception(
ImportError("The import {} in file {} line {} doesn't exist".format(e, self.name, l)) ImportError("The import {} in file {} line {} doesn't exist".format(e, self.name, l))
) )
self.local_dict_of_imports[e] = pp
self.is_global_dict_of_imports_initialized = True self.is_global_dict_of_imports_initialized = True
return self.local_dict_of_imports return self.local_dict_of_imports