refactor: change name of self-documenting constant
The previous constant name implied that a user id was returned and that it cannot be relied upon. That is not the case. -1 is an error flag and the constant should identify it as such.
This commit is contained in:
parent
af4ebebf44
commit
60f65668ed
|
@ -329,9 +329,9 @@ def get_user_id() -> int | None:
|
|||
else:
|
||||
# On other platforms, a return value of -1 is assumed to indicate that
|
||||
# the current process's real user id cannot be determined.
|
||||
UNRELIABLE = -1
|
||||
ERROR = -1
|
||||
uid = os.getuid()
|
||||
return uid if uid != UNRELIABLE else None
|
||||
return uid if uid != ERROR else None
|
||||
|
||||
|
||||
# Perform exhaustiveness checking.
|
||||
|
|
Loading…
Reference in New Issue