JuliaPy / PyCall.jl

Package to call Python functions from the Julia language
MIT License
1.47k stars 189 forks source link

Assignment to `exc` in soft scope is ambiguous #905

Open heetbeet opened 3 years ago

heetbeet commented 3 years ago

Suppress warning:

┌ Warning: Assignment to `#6#exc` in soft scope is ambiguous because a global variable by the same name exists: `#6#exc` will be treated as a new local. Disambiguate by using `local #6#exc` to suppress this warning or `global #6#exc` to assign to the existing global variable.
└ @ C:\Users\simon\devel\empty_app\bin\julia\localdepot\packages\PyCall\BD546\src\PyCall.jl:654
codecov-commenter commented 3 years ago

Codecov Report

Merging #905 (9c7e90a) into master (8a98fb4) will decrease coverage by 0.42%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #905      +/-   ##
==========================================
- Coverage   68.03%   67.60%   -0.43%     
==========================================
  Files          20       20              
  Lines        1980     1982       +2     
==========================================
- Hits         1347     1340       -7     
- Misses        633      642       +9     
Flag Coverage Δ
unittests 67.60% <100.00%> (-0.43%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/PyCall.jl 68.40% <100.00%> (-1.66%) :arrow_down:
src/pyinit.jl 79.59% <0.00%> (-3.07%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 8a98fb4...9c7e90a. Read the comment docs.

stevengj commented 3 years ago

This isn't the correct fix because it only works for @pywith statements in global scope.

stevengj commented 3 years ago

The right fix is probably to wrap the whole try .. finally in a let exc=true block.