Skip to content

Commit 0bf3986

Browse files
committed
Fix crash when $MAIL is set but file is empty
1 parent eab3aa0 commit 0bf3986

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
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.2 (in development)
2+
-----------------------
3+
- Fix crash when `$MAIL` is set but file is empty
4+
15
v0.7.1 (2024-05-23)
26
-------------------
37
- Fixed support for custom venv prompt prefixes

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.1"
22+
__version__ = "0.7.2.dev1"
2323
__author__ = "John Thorvald Wodder II"
2424
__author_email__ = "ps1@varonathe.org"
2525
__license__ = "MIT"

src/jwodder_ps1/info.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ class PromptInfo:
4242
@classmethod
4343
def get(cls, git: bool = True, git_timeout: float = 3) -> PromptInfo:
4444
try:
45-
if os.stat(os.environ["MAIL"]).st_size > 0:
46-
mail = True
45+
mail = os.stat(os.environ["MAIL"]).st_size > 0
4746
except (KeyError, FileNotFoundError):
4847
mail = False
4948

0 commit comments

Comments
 (0)