Catch a ValueError when checking if a user exists

This commit is contained in:
Lee Bousfield 2016-07-23 15:03:22 -04:00
parent 91a9c35bd3
commit ff108ef24b

View file

@ -40,7 +40,7 @@ def user_exists(username):
try:
pwd.getpwnam(username)
return True
except KeyError:
except (KeyError, ValueError):
return False