Restore $! when catching exception. #615

merged 1 commit into from Apr 24, 2013


None yet

3 participants


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.


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.


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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment