Restore $! when catching exception. #615

Merged
merged 1 commit into from Apr 24, 2013

Projects

None yet

3 participants

@tychobrailleur
Contributor

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
Member

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
Contributor

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 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