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

Fix undefined variable #270

Merged
merged 1 commit into from
May 9, 2023
Merged

Fix undefined variable #270

merged 1 commit into from
May 9, 2023

Conversation

chzhyang
Copy link
Contributor

NameError: name 'root' is not defined: parameter root of VenvPipInstallFailedError() is undefined, it should be self.root.

NameError before changed root to self.root

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/__main__.py", line 2, in <module>
    pyperformance.cli.main()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/cli.py", line 317, in main
    _main()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/cli.py", line 301, in _main
    cmd_run(options, benchmarks)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/commands.py", line 180, in cmd_run
    suite, errors = run_benchmarks(benchmarks, executable, options)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/run.py", line 61, in run_benchmarks
    common = VenvForBenchmarks.ensure(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/venv.py", line 193, in ensure
    return cls.create(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/venv.py", line 162, in create
    self.ensure_pip(upgrade=upgrade)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/_venv.py", line 220, in ensure_pip
    raise VenvPipInstallFailedError(root, ec)
NameError: name 'root' is not defined

After changed root to self.root:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/__main__.py", line 2, in <module>
    pyperformance.cli.main()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/cli.py", line 317, in main
    _main()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/cli.py", line 301, in _main
    cmd_run(options, benchmarks)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/commands.py", line 180, in cmd_run
    suite, errors = run_benchmarks(benchmarks, executable, options)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/run.py", line 61, in run_benchmarks
    common = VenvForBenchmarks.ensure(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/venv.py", line 193, in ensure
    return cls.create(
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/venv.py", line 162, in create
    self.ensure_pip(upgrade=upgrade)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/pyperformance/_venv.py", line 220, in ensure_pip
    raise VenvPipInstallFailedError(self.root, ec)
pyperformance._venv.VenvPipInstallFailedError: failed to install pip in venv /home/ubuntu/pyperformance/venv/cpython3.11-f90a0555cbd0-compat-07e19f9c3993

@kumaraditya303 kumaraditya303 merged commit 6dc2c9a into python:main May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants