Skip to content

Commit

Permalink
Use rb_rescue2 to catch all exceptions instead of rb_rescue which onl…
Browse files Browse the repository at this point in the history
…y catches StandardError

git-svn-id: svn://rubyforge.org/var/svn/tcl/trunk@10 017b7ecb-b1d0-4998-98d6-e9014aaf4887
  • Loading branch information
sstephenson committed Dec 7, 2007
1 parent fe5c3e6 commit 3f92d94
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion TODO
@@ -1,3 +1,4 @@
* Tcl::Interp#to_tcl should account for interpreter aliases (see http://wiki.tcl.tk/8766) and namespaces. * Tcl::Interp#to_tcl should account for interpreter aliases (see http://wiki.tcl.tk/8766) and namespaces.


* ConsoleInterp#exit crashes with "DeleteInterpProc called with active evals". * Implement ConsoleInterp#exit.

5 changes: 0 additions & 5 deletions script/console
Expand Up @@ -5,18 +5,13 @@ require File.join(File.dirname(__FILE__), *%w".. lib tcl")
class ConsoleInterp < Tcl::Interp class ConsoleInterp < Tcl::Interp
def initialize def initialize
super super
expose :exit
expose :ruby_eval expose :ruby_eval
end end


def tcl_ruby_eval(script) def tcl_ruby_eval(script)
Kernel.eval(script) Kernel.eval(script)
end end


def tcl_exit
exit
end

protected protected
def expose(name) def expose(name)
_!(:interp, :alias, nil, name, nil, :interp_send, name) _!(:interp, :alias, nil, name, nil, :interp_send, name)
Expand Down
2 changes: 1 addition & 1 deletion src/tcl.c
Expand Up @@ -55,7 +55,7 @@ static int rb_tcl_interp_send(ClientData clientData, Tcl_Interp *interp, int obj


VALUE args = rb_ary_new3(2, (VALUE) clientData, interp_receive_args); VALUE args = rb_ary_new3(2, (VALUE) clientData, interp_receive_args);


if (rb_rescue(rb_tcl_interp_send_begin, args, rb_tcl_interp_send_rescue, args) == Qtrue) { if (rb_rescue2(rb_tcl_interp_send_begin, args, rb_tcl_interp_send_rescue, args, rb_eException) == Qtrue) {
return TCL_RETURN; return TCL_RETURN;
} else { } else {
return TCL_ERROR; return TCL_ERROR;
Expand Down

0 comments on commit 3f92d94

Please sign in to comment.