summaryrefslogtreecommitdiff
path: root/scripts/template_verifier.py
diff options
context:
space:
mode:
authorYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-15 18:56:25 +0200
committerYchebotarev ProductEngine <ychebotarev@productengine.com>2010-01-15 18:56:25 +0200
commit91e8b4bc64ef296893b6a72cc57a3ae8a5d49d03 (patch)
treec7a5dfbcfa87ac6b6578a057e4e4746bdd58c555 /scripts/template_verifier.py
parent17a72e5e51cae48c7cd6f7f3dda06c895dd482c8 (diff)
parentb21fca13e6bea9420f80a35163d25a33b929bbd1 (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'scripts/template_verifier.py')
-rwxr-xr-xscripts/template_verifier.py9
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)