diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2010-02-02 14:53:01 -0800 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2010-02-02 14:53:01 -0800 |
commit | d14ecbace5c2d041fe4717c7d346083535267e24 (patch) | |
tree | ae95d038763d50cd5fc2f962f144c028059b6c4f /scripts/template_verifier.py | |
parent | 58f813a136a5a889e01b39e96714af91402321ba (diff) | |
parent | 2c0418dfe0a3e903210516a70fd947870c340bf8 (diff) |
merge
Diffstat (limited to 'scripts/template_verifier.py')
-rwxr-xr-x | scripts/template_verifier.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/template_verifier.py b/scripts/template_verifier.py index 8bb5e1d76d..d5fc119270 100755 --- a/scripts/template_verifier.py +++ b/scripts/template_verifier.py @@ -203,8 +203,13 @@ def getuser(): import getpass return getpass.getuser() except ImportError: - import win32api - return win32api.GetUserName() + import ctypes + MAX_PATH = 260 # according to a recent WinDef.h + name = ctypes.create_unicode_buffer(MAX_PATH) + namelen = ctypes.c_int(len(name)) # len in chars, NOT bytes + if not ctypes.windll.advapi32.GetUserNameW(name, ctypes.byref(namelen)): + raise ctypes.WinError() + return name.value def local_master_cache_filename(): """Returns the location of the master template cache (which is in the system tempdir) |