mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 14:13:33 -07:00
add jaraco to test sym links on Windows. Fixes #894
This commit is contained in:
parent
fd5ee775e0
commit
52cc753881
50 changed files with 3862 additions and 7 deletions
15
libs/jaraco/windows/user.py
Normal file
15
libs/jaraco/windows/user.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import ctypes
|
||||
from .api import errors
|
||||
from .api.user import GetUserName
|
||||
from .error import WindowsError, handle_nonzero_success
|
||||
|
||||
def get_user_name():
|
||||
size = ctypes.wintypes.DWORD()
|
||||
try:
|
||||
handle_nonzero_success(GetUserName(None, size))
|
||||
except WindowsError as e:
|
||||
if e.code != errors.ERROR_INSUFFICIENT_BUFFER:
|
||||
raise
|
||||
buffer = ctypes.create_unicode_buffer(size.value)
|
||||
handle_nonzero_success(GetUserName(buffer, size))
|
||||
return buffer.value
|
Loading…
Add table
Add a link
Reference in a new issue