ruby-changes:21352
From: tenderlove <ko1@a...>
Date: Wed, 5 Oct 2011 01:25:11 +0900 (JST)
Subject: [ruby-changes:21352] tenderlove:r33401 (trunk): * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
tenderlove 2011-10-05 01:24:58 +0900 (Wed, 05 Oct 2011) New Revision: 33401 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33401 Log: * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue since postfix rescue cannot receive the exception class. Thanks nagachika! Modified files: trunk/ChangeLog trunk/ext/psych/lib/psych/scalar_scanner.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 33400) +++ ChangeLog (revision 33401) @@ -1,3 +1,9 @@ +Wed Oct 5 01:22:08 2011 Aaron Patterson <aaron@t...> + + * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue + since postfix rescue cannot receive the exception class. Thanks + nagachika! + Tue Oct 4 21:10:08 2011 Nobuyoshi Nakada <nobu@r...> * class.c (class_alloc): allocate extra memory after containing Index: ext/psych/lib/psych/scalar_scanner.rb =================================================================== --- ext/psych/lib/psych/scalar_scanner.rb (revision 33400) +++ ext/psych/lib/psych/scalar_scanner.rb (revision 33401) @@ -74,13 +74,19 @@ end i when FLOAT - return Float(string.gsub(/[,_]/, '')) rescue ArgumentError + begin + return Float(string.gsub(/[,_]/, '')) + rescue ArgumentError + end @string_cache[string] = true string else if string.count('.') < 2 - return Integer(string.gsub(/[,_]/, '')) rescue ArgumentError + begin + return Integer(string.gsub(/[,_]/, '')) + rescue ArgumentError + end end @string_cache[string] = true -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/