Fix deprecation warning in Pkg caused by #7919