diff --git a/test/path.jl b/test/path.jl
index 2515d765d8ca9..a2824a24c8bce 100644
--- a/test/path.jl
+++ b/test/path.jl
@@ -314,7 +314,7 @@
@testset "uripath" begin
host = if Sys.iswindows()
""
- elseif ispath("/proc/sys/fs/binfmt_misc/WSLInterop")
+ elseif Sys.detectwsl()
distro = get(ENV, "WSL_DISTRO_NAME", "") # See
"wsl%24/$distro" # See and
else