Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored May 9, 2024
2 parents c52802e + 7864fde commit 4e59d47
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.12.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.2"
rev: "v0.4.3"
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def run(args=None, options=None, env=None):
print(f"subprocess call failed for {exception.cmd} with code {exception.code}") # noqa: T201
print(exception.out, file=sys.stdout, end="") # noqa: T201
print(exception.err, file=sys.stderr, end="") # noqa: T201
raise SystemExit(exception.code) # noqa: TRY200, B904
raise SystemExit(exception.code) # noqa: B904


class LogSession:
Expand Down
5 changes: 3 additions & 2 deletions src/virtualenv/activation/python/activate_this.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
Activate virtualenv for current interpreter:
Use exec(open(this_file).read(), {'__file__': this_file}).
import runpy
runpy.run_path(this_file)
This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
""" # noqa: D415
Expand All @@ -15,7 +16,7 @@
try:
abs_file = os.path.abspath(__file__)
except NameError as exc:
msg = "You must use exec(open(this_file).read(), {'__file__': this_file})"
msg = "You must use import runpy; runpy.run_path(this_file)"
raise AssertionError(msg) from exc

bin_dir = os.path.dirname(abs_file)
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/create/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def run(): # noqa: PLR0912
except (ValueError, TypeError) as exception: # pragma: no cover
sys.stderr.write(repr(exception))
sys.stdout.write(repr(result)) # pragma: no cover
raise SystemExit(1) # noqa: TRY200, B904 # pragma: no cover
raise SystemExit(1) # noqa: B904 # pragma: no cover


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/create/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from virtualenv.info import IS_WIN


class Describe(ABC):
class Describe:
"""Given a host interpreter tell us information about what the created interpreter might look like."""

suffix = ".exe" if IS_WIN else ""
Expand Down

0 comments on commit 4e59d47

Please sign in to comment.