Skip to content

Commit

Permalink
Merge pull request #529 from larskanis/fir-warn-on-trufferuby
Browse files Browse the repository at this point in the history
Fix error on warn with category on Truffleruby
  • Loading branch information
larskanis authored Apr 27, 2023
2 parents 83990c6 + 9ded3b9 commit f23782f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/pg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,15 @@ module TextEncoder
require 'pg/tuple'
autoload :VERSION, 'pg/version'


# Avoid "uninitialized constant Truffle::WarningOperations" on Truffleruby up to 22.3.1
if RUBY_ENGINE=="truffleruby" && !defined?(Truffle::WarningOperations)
module TruffleFixWarn
def warn(str, category=nil)
super(str)
end
end
Warning.extend(TruffleFixWarn)
end

end # module PG

0 comments on commit f23782f

Please sign in to comment.