JuliaLang / Compat.jl

Compatibility across Julia versions
Other
145 stars 117 forks source link

Add `redirect_stdio` (feature from `v1.7`) #801

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

From https://github.com/JuliaLang/julia/pull/37978. This completely copies the code from that PR, with one fix for samefile -> Base.Filesystem.samefile. Unit tests are copied as well.

codecov[bot] commented 1 year ago

Codecov Report

Merging #801 (3ce84cb) into master (70ab162) will increase coverage by 0.84%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #801      +/-   ##
==========================================
+ Coverage   91.69%   92.54%   +0.84%     
==========================================
  Files           2        2              
  Lines         265      295      +30     
==========================================
+ Hits          243      273      +30     
  Misses         22       22              
Impacted Files Coverage Δ
src/Compat.jl 93.06% <100.00%> (+0.85%) :arrow_up:
MilesCranmer commented 1 year ago

Actually wait, I'm being an idiot. I should have just copied it in verbatim – the other functionality added has no effect on existing redirection.

MilesCranmer commented 1 year ago

Updated. Now it's a full copy of the code with everything working.

MilesCranmer commented 1 year ago

Done!