Skip to content

Commit a40dda5

Browse files
committed
Fix support for custom venv prompt prefixes
1 parent a77e9ee commit a40dda5

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v0.7.1 (in development)
2+
-----------------------
3+
- Fixed support for custom venv prompt prefixes
4+
15
v0.7.0 (2024-05-13)
26
-------------------
37
- The branch name/`HEAD` description is now truncated if it gets too long.

src/jwodder_ps1/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Visit <https://github.com/jwodder/ps1.py> for more information.
2020
"""
2121

22-
__version__ = "0.7.0"
22+
__version__ = "0.7.1.dev1"
2323
__author__ = "John Thorvald Wodder II"
2424
__author_email__ = "ps1@varonathe.org"
2525
__license__ = "MIT"

src/jwodder_ps1/info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def get(cls, git: bool = True, git_timeout: float = 3) -> PromptInfo:
6565
for line in fp:
6666
line = line.strip()
6767
if m := re.match(r"^prompt\s*=\s*", line):
68-
prompt = line[m.end() :]
69-
if re.fullmatch(r'([\x27"]).*\1', prompt):
68+
venv_prompt = line[m.end() :]
69+
if re.fullmatch(r'([\x27"]).*\1', venv_prompt):
7070
# repr-ized prompt produced by venv
7171
try:
72-
venv_prompt = literal_eval(prompt)
72+
venv_prompt = literal_eval(venv_prompt)
7373
except Exception:
7474
pass
7575
break

0 commit comments

Comments
 (0)