Skip to content

Commit

Permalink
fix #2238 if cwd() cannot be determined always return "" instead of None
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Apr 17, 2023
1 parent 55b9c5e commit c7e635d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psutil/_psbsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def cwd(self):
# sometimes we get an empty string, in which case we turn
# it into None
if OPENBSD and self.pid == 0:
return None # ...else it would raise EINVAL
return "" # ...else it would raise EINVAL
elif NETBSD or HAS_PROC_OPEN_FILES:
# FreeBSD < 8 does not support functions based on
# kinfo_getfile() and kinfo_getvmmap()
Expand Down

0 comments on commit c7e635d

Please sign in to comment.