PyCall.jl icon indicating copy to clipboard operation
PyCall.jl copied to clipboard

Assignment to `exc` in soft scope is ambiguous

Open heetbeet opened this issue 4 years ago • 3 comments

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

heetbeet avatar Jun 02 '21 21:06 heetbeet

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.

codecov-commenter avatar Jun 03 '21 17:06 codecov-commenter

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

stevengj avatar Jun 03 '21 17:06 stevengj

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

stevengj avatar Jun 03 '21 18:06 stevengj