doc: remove unwanted implication

Returning None does not mean that all future calls to the underlying
platform will result in a return value of None. It is a certainty for win32
and Emscripten platforms but only a possibility for other platforms.
The documentation should only state that the *current* call to the
underlying platform was unsuccessful.
This commit is contained in:
Warren 2023-08-27 10:41:24 +10:00
parent 60f65668ed
commit c7b602ca05
1 changed files with 2 additions and 2 deletions

View File

@ -314,7 +314,7 @@ def safe_isclass(obj: object) -> bool:
def get_user_id() -> int | None: def get_user_id() -> int | None:
"""Return the current process's real user id or None if it cannot be """Return the current process's real user id or None if it could not be
determined. determined.
:return: The user id or None if it could not be determined. :return: The user id or None if it could not be determined.
@ -328,7 +328,7 @@ def get_user_id() -> int | None:
return None return None
else: else:
# On other platforms, a return value of -1 is assumed to indicate that # On other platforms, a return value of -1 is assumed to indicate that
# the current process's real user id cannot be determined. # the current process's real user id could not be determined.
ERROR = -1 ERROR = -1
uid = os.getuid() uid = os.getuid()
return uid if uid != ERROR else None return uid if uid != ERROR else None