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

Restore $! when catching exception. #615

Merged
merged 1 commit into from Apr 24, 2013

Conversation

Projects
None yet
3 participants
@tychobrailleur
Copy link
Contributor

commented Mar 30, 2013

Hack-ish workaround for JRUBY-7134 that restores $! when an exception is thrown when checking whether the dir exists.

Added also pull request for rubyspec.

@BanzaiMan

This comment has been minimized.

Copy link
Member

commented Mar 30, 2013

This works, but I am a bit worried about committing this. I have not looked at MRI source, but ideally we should add smarts to FileStat to avoid setting $! in the first place if the operand is a directory.

@tychobrailleur

This comment has been minimized.

Copy link
Contributor Author

commented Mar 30, 2013

Yup. As I said, hack-ish. The alternative is to modify jnr-posix directly, or amend JRubyPOSIXHandler to interact with it, but I was a bit reluctant to do that.

enebo added a commit that referenced this pull request Apr 24, 2013

Merge pull request #615 from tychobrailleur/exist_fix
Restore $! when catching exception.  In most cases jnr-posix on an error will throw and not get caught like this.   This is a special case and without significant changes jnr-posix this looks like the best fix to me.

@enebo enebo merged commit de7171d into jruby:master Apr 24, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.