changeset 36412:03eff66adb3b

acl: replace bare getpass.getuser() by platform function Follows up dbadf28d4db0. bytestr() shouldn't be applied here because getuser() isn't guaranteed to be all in ASCII. This change means GetUserNameA() is used on Windows, but that's probably better than trying to get the current user name in UNIX way.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 25 Feb 2018 11:13:01 +0900
parents 38f480502043
children f493829b74dd
files hgext/acl.py
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/acl.py	Sat Feb 24 11:21:14 2018 -0800
+++ b/hgext/acl.py	Sun Feb 25 11:13:01 2018 +0900
@@ -193,14 +193,11 @@
 
 from __future__ import absolute_import
 
-import getpass
-
 from mercurial.i18n import _
 from mercurial import (
     error,
     extensions,
     match,
-    pycompat,
     registrar,
     util,
 )
@@ -341,7 +338,7 @@
             user = urlreq.unquote(url[3])
 
     if user is None:
-        user = pycompat.bytestr(getpass.getuser())
+        user = util.getuser()
 
     ui.debug('acl: checking access for user "%s"\n' % user)