mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-22 22:32:23 +00:00
Use SetErrorMode and related constants from pywin32
This commit is contained in:
parent
891ef3eefd
commit
d78e72595a
@ -11,19 +11,19 @@ def initialize():
|
|||||||
|
|
||||||
import codecs, re
|
import codecs, re
|
||||||
from ctypes import WINFUNCTYPE, WinError, windll, POINTER, byref, c_int, get_last_error
|
from ctypes import WINFUNCTYPE, WinError, windll, POINTER, byref, c_int, get_last_error
|
||||||
from ctypes.wintypes import BOOL, HANDLE, DWORD, UINT, LPWSTR, LPCWSTR, LPVOID
|
from ctypes.wintypes import BOOL, HANDLE, DWORD, LPWSTR, LPCWSTR, LPVOID
|
||||||
|
|
||||||
from allmydata.util import log
|
from allmydata.util import log
|
||||||
from allmydata.util.encodingutil import canonical_encoding
|
from allmydata.util.encodingutil import canonical_encoding
|
||||||
|
|
||||||
# <https://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx>
|
# <https://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx>
|
||||||
SetErrorMode = WINFUNCTYPE(
|
from win32api import (
|
||||||
UINT, UINT,
|
SetErrorMode,
|
||||||
use_last_error=True
|
)
|
||||||
)(("SetErrorMode", windll.kernel32))
|
from win32con import (
|
||||||
|
SEM_FAILCRITICALERRORS,
|
||||||
SEM_FAILCRITICALERRORS = 0x0001
|
SEM_NOOPENFILEERRORBOX,
|
||||||
SEM_NOOPENFILEERRORBOX = 0x8000
|
)
|
||||||
|
|
||||||
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX)
|
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user