Skip to content

Commit e809ac2

Browse files
committed
Move constants to a top level module
1 parent 53c33b5 commit e809ac2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

win32ctypes/pywin32/_constants.py renamed to win32ctypes/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
CRED_PERSIST_SESSION = 0x1
1212
CRED_PERSIST_LOCAL_MACHINE = 0x2
1313
CRED_PERSIST_ENTERPRISE = 0x3
14-
CRED_PRESERVE_CREDENTIAL_BLOB = 0
14+
CRED_PRESERVE_CREDENTIAL_BLOB = 0x1
1515

1616
# Library related constants
1717
LOAD_LIBRARY_AS_DATAFILE = 0x2

win32ctypes/pywin32/win32cred.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
""" Interface to credentials management functions. """
99
from win32ctypes.core import _authentication, _common, _backend
1010
from .pywintypes import pywin32error as _pywin32error
11-
from ._constants import (
11+
12+
# Bring constants into namespace
13+
from win32ctypes.constants import (
1214
CRED_TYPE_GENERIC,
1315
CRED_PERSIST_SESSION,
1416
CRED_PERSIST_LOCAL_MACHINE,
15-
CRED_PERSIST_ENTERPRISE,
16-
CRED_PRESERVE_CREDENTIAL_BLOB)
17-
17+
CRED_PERSIST_ENTERPRISE) # noqa
1818

19-
def CredWrite(Credential, Flags=CRED_PRESERVE_CREDENTIAL_BLOB):
19+
def CredWrite(Credential, Flags=0):
2020
""" Creates or updates a stored credential.
2121
2222
Parameters
@@ -25,7 +25,7 @@ def CredWrite(Credential, Flags=CRED_PRESERVE_CREDENTIAL_BLOB):
2525
A dictionary corresponding to the PyWin32 ``PyCREDENTIAL``
2626
structure.
2727
Flags : int
28-
Always pass ``CRED_PRESERVE_CREDENTIAL_BLOB`` (i.e. 0).
28+
``CRED_PRESERVE_CREDENTIAL_BLOB`` or 0. Default is 0.
2929
3030
"""
3131
c_creds = _authentication.CREDENTIAL.fromdict(Credential, Flags)

0 commit comments

Comments
 (0)