Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 85c563a

Browse files
DirectXMan12frozencemetery
authored andcommitted
Handle GSS_C_NO_OID_SET when creating sets
Some methods can return GSS_C_NO_OID_SET on success, so we should handle that in our set converter by returning the empty set. Fixes #148
1 parent 2a2b47b commit 85c563a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎gssapi/raw/cython_converters.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ cdef gss_OID_set c_get_mech_oid_set(object mechs):
2929
cdef object c_create_oid_set(gss_OID_set mech_set, bint free=True):
3030
"""Convert a GSS OID set struct to a set of OIDs"""
3131

32+
if mech_set == GSS_C_NO_OID_SET:
33+
# return the empty set if the we get passed the C equivalent
34+
# (it could be argued that the C equivalent is closer to None,
35+
# but returning None would make the API harder to work with,
36+
# without much value)
37+
return set()
38+
3239
py_set = set()
3340
cdef i
3441
for i in range(mech_set.count):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /