Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/return and raise #1

Closed
wants to merge 5 commits into from
Closed

Conversation

DirectXMan12
Copy link
Member

No description provided.

DirectXMan12 and others added 5 commits November 4, 2014 13:04
This commit makes it so that when an exception is thrown in
the `step` method of SecurityContext, if it has an attached token,
the token is returned and the exception and traceback are saved.
The exception and traceback will be reraised by `complete` the next
time it is checked.
Also only set structure members if the corresponding python variable is
not None, avoid using GSS_C_AF_NULLADDR by default as address values are
protocol dependent, only the caller knows what is the convention for each
application protocol.

Signed-off-by: Simo Sorce <simo@redhat.com>
Commit 12e88c3 miscopied the
sizeof call, allocating the size of a pointer instead of the size
of the underlying struct.  This fixes that.
Previously, `_last_err` was only check on complete.  It is now
checked on every method.  This ensures that the error actually
gets thrown, and makes it more likely that the stored traceback
actually gets deleted.  This functionality can now be disabled
by setting the `__DEFER_STEP_ERRORS__` class variable in
`SecurityContext` to `False`.
Python 3 automatically saves the traceback with exceptions and uses
it when reraising the exception, so we don't have to manually save
the traceback.  Also, just use "raise" instead of six.reraise
when simply choosing to raise the exception without saving it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants