* ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue

since postfix rescue cannot receive the exception class. Thanks
  nagachika!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tenderlove 2011-10-04 16:24:58 +00:00
Родитель 92a05ea2cf
Коммит b7c66e31de
2 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Oct 5 01:22:08 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* 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@ruby-lang.org>
* class.c (class_alloc): allocate extra memory after containing

Просмотреть файл

@ -74,13 +74,19 @@ module Psych
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