Skip to content

Commit

Permalink
Merge pull request #569 from koic/fix_build_error_when_using_psych_4_0
Browse files Browse the repository at this point in the history
Fix a build error when using Psych 4.0
  • Loading branch information
radar authored Nov 2, 2021
2 parents 3d0f144 + 1edbf5c commit 916f9f4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/i18n/backend/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ def load_rb(filename)
# toplevel keys.
def load_yml(filename)
begin
YAML.load_file(filename)
if YAML.respond_to?(:unsafe_load_file) # Psych 4.0 way
YAML.unsafe_load_file(filename)
else
YAML.load_file(filename)
end
rescue TypeError, ScriptError, StandardError => e
raise InvalidLocaleData.new(filename, e.inspect)
end
Expand Down

0 comments on commit 916f9f4

Please sign in to comment.