Skip to content

Commit dbed49f

Browse files
authored
Fix ExplicitImports to work with --depwarn=error (#132)
1 parent 70b4052 commit dbed49f

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ExplicitImports"
22
uuid = "7d51a73a-1435-4ff3-83d9-f097790105c7"
33
authors = ["Eric P. Hanson"]
4-
version = "1.13.1"
4+
version = "1.13.2"
55

66
[deps]
77
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"

src/ExplicitImports.jl

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,10 +308,6 @@ function filter_to_module(file_analysis::FileAnalysis, mod::Module)
308308
return (; needs_explicit_import, unnecessary_explicit_import, tainted, per_usage_info)
309309
end
310310

311-
if VERSION < v"1.9-"
312-
getglobal(mod, name) = getfield(mod, name)
313-
end
314-
315311
# https://github.com/JuliaLang/julia/issues/53574
316312
function _parentmodule(mod)
317313
mod === Base && return Base
@@ -345,12 +341,8 @@ function _find_submodules(mod)
345341
is_submodule = try
346342
value = getglobal(mod, name)
347343
value isa Module && _parentmodule(value) == mod
348-
catch e
349-
if e isa UndefVarError
350-
false
351-
else
352-
rethrow()
353-
end
344+
catch
345+
false
354346
end
355347
if is_submodule
356348
submod = getglobal(mod, name)
@@ -359,8 +351,6 @@ function _find_submodules(mod)
359351
end
360352
end
361353
end
362-
# pre-1.9, there are not package extensions
363-
VERSION < v"1.9-" && return sub_modules
364354

365355
# Add extensions to the set of submodules if present
366356
project_file = get_project_file(mod)

0 commit comments

Comments
 (0)