Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update config_parser.py #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions dhalsim/parser/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from pathlib import Path

import yaml
from yamlinclude import YamlIncludeConstructor
# from yamlinclude import YamlIncludeConstructor
from yaml_include import Constructor
from schema import Schema, Or, And, Use, Optional, SchemaError, Regex

from dhalsim.parser.input_parser import InputParser
Expand Down Expand Up @@ -626,9 +627,9 @@ def __init__(self, config_path: Path):

self.config_path = config_path.absolute()

YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader,
base_dir=config_path.absolute().parent)

# YamlIncludeConstructor.add_to_loader_class(loader_class=yaml.FullLoader,
# base_dir=config_path.absolute().parent)
yaml.add_constructor("!include", Constructor(base_dir=config_path.absolute().parent), FullLoader)
try:
self.data = self.apply_schema(self.config_path)
except SchemaError as exc:
Expand Down