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

Suggesting minor correction to the source code #30

Open
itlchriss opened this issue Nov 1, 2021 · 0 comments
Open

Suggesting minor correction to the source code #30

itlchriss opened this issue Nov 1, 2021 · 0 comments

Comments

@itlchriss
Copy link

As the pyyaml has updated, the load function requires a Loader specified.
In the scripts/semantic_index.py, at line 140, the use of load is simply loading a simple yaml.
As the document suggested, the line

loaded = yaml.load(infile)

can be replaced with

loaded = yaml.safe_load(infile)

to avoid the following error

Traceback (most recent call last):
  File "../scripts/semparse.py", line 197, in <module>
    main()
  File "../scripts/semparse.py", line 82, in main
    SEMANTIC_INDEX = SemanticIndex(ARGS.templates)
  File "ccg2lambda/scripts/semantic_index.py", line 32, in __init__
    self.rules = load_semantic_rules(contents)
  File "ccg2lambda/scripts/semantic_index.py", line 140, in load_semantic_rules
    loaded = yaml.load(infile)
TypeError: load() missing 1 required positional argument: 'Loader'

Tested with successfully running the tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant