Skip to content

UnboundLocalError: cannot access local variable 'inp' where it is not associated with a value #7

@cerumo

Description

@cerumo

When running leetscrape question 26, I'm getting:

Generating code stub for 26. remove-duplicates-from-sorted-array
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\new\winpython\WPy64-31220\python-3.12.2.amd64\Scripts\leetscrape.exe\__main__.py", line 7, in <module>
  File "C:\new\winpython\WPy64-31220\python-3.12.2.amd64\Lib\site-packages\leetscrape\scripts.py", line 164, in leetscrape
    args.func(args, parser)
  File "C:\new\winpython\WPy64-31220\python-3.12.2.amd64\Lib\site-packages\leetscrape\scripts.py", line 21, in leetscrape_question
    fcs.generate(
  File "C:\new\winpython\WPy64-31220\python-3.12.2.amd64\Lib\site-packages\leetscrape\generate_code_stub.py", line 74, in generate
    test_to_write = self._create_test_file(code_to_write)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\new\winpython\WPy64-31220\python-3.12.2.amd64\Lib\site-packages\leetscrape\generate_code_stub.py", line 225, in _create_test_file
    input_string, output_string = self._get_parameters(
                                  ^^^^^^^^^^^^^^^^^^^^^
  File "C:\new\winpython\WPy64-31220\python-3.12.2.amd64\Lib\site-packages\leetscrape\generate_code_stub.py", line 181, in _get_parameters
    parameter_dict = parse_args(inp)  # type: ignore
                                ^^^
UnboundLocalError: cannot access local variable 'inp' where it is not associated with a value

Also, do you have the list of questions and solutions etc already scraped available somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions