check loaded_modules instead of Main for warnings about StatsPlots recipes (#4123)

* check loaded_modules instead of Main

* format
This commit is contained in:
Simon Christ 2022-03-01 09:23:10 +01:00 committed by GitHub
parent 5130da5a40
commit b34f8b87c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1585,7 +1585,11 @@ function RecipesPipeline.preprocess_attributes!(plotattributes::AKW)
# warnings for moved recipes # warnings for moved recipes
st = get(plotattributes, :seriestype, :path) st = get(plotattributes, :seriestype, :path)
if st in (:boxplot, :violin, :density) && !isdefined(Main, :StatsPlots) if st in (:boxplot, :violin, :density) &&
!haskey(
Base.loaded_modules,
Base.PkgId(Base.UUID("f3b207a7-027a-5e70-b257-86293d7955fd"), "StatsPlots"),
)
@warn( @warn(
"seriestype $st has been moved to StatsPlots. To use: \`Pkg.add(\"StatsPlots\"); using StatsPlots\`" "seriestype $st has been moved to StatsPlots. To use: \`Pkg.add(\"StatsPlots\"); using StatsPlots\`"
) )