Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around deprecation of Base.isbindingresolved in julia nightly #322

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased - 2025-XX-XX

### Changed

- Avoid deprecation warnings concerning `Base.isbindingresolved` with julia nightly. ([#322])

## Version [v0.8.10] - 2024-01-26

Expand Down
11 changes: 10 additions & 1 deletion src/exports.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# avoid Base.isbindingresolved deprecation in https://github.com/JuliaLang/julia/pull/57253
function isbindingresolved(m::Module, s::Symbol)
@static if VERSION >= v"1.12.0-"

Check warning on line 3 in src/exports.jl

View check run for this annotation

Codecov / codecov/patch

src/exports.jl#L3

Added line #L3 was not covered by tests
return true
else
return Base.isbindingresolved(m, s)
end
end

function walkmodules(f, x::Module)
f(x)
for n in names(x; all = true)
# `isdefined` and `getproperty` can trigger deprecation warnings
if Base.isbindingresolved(x, n) && !Base.isdeprecated(x, n)
if isbindingresolved(x, n) && !Base.isdeprecated(x, n)
isdefined(x, n) || continue
y = getproperty(x, n)
if y isa Module && y !== x && parentmodule(y) === x
Expand Down
Loading