8000 PythonTypeName property added to the PythonException object. by dmitriyse · Pull Request #597 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

PythonTypeName property added to the PythonException object. #597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 10, 2018

Conversation

dmitriyse
Copy link
Contributor
@dmitriyse dmitriyse commented Jan 13, 2018

What does this implement/fix? Explain your changes.

Introduced the new property "PythonTypeName" in the PythonException class.
It's very useful in scenarios when PythonException python type should be determined after a GIL lock has been released.
...

Does this close any currently open issues?

...

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@codecov
Copy link
codecov bot commented Feb 8, 2018

Codecov Report

Merging #597 into master will increase coverage by 1.9%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #597     +/-   ##
=========================================
+ Coverage   75.09%   76.99%   +1.9%     
=========================================
  Files          60       64      +4     
  Lines        5480     5612    +132     
  Branches      864      888     +24     
=========================================
+ Hits         4115     4321    +206     
+ Misses       1064     1002     -62     
+ Partials      301      289     -12
Flag Coverage Δ
#setup_linux 69.42% <ø> (ø) ⬆️
#setup_windows 76.17% <100%> (+2.1%) ⬆️
Impacted Files Coverage Δ
src/runtime/pythonexception.cs 66.1% <100%> (+1.81%) ⬆️
src/runtime/runtime.cs 90.98% <0%> (-0.76%) ⬇️
src/runtime/interop.cs 95.73% <0%> (-0.49%) ⬇️
src/runtime/pythonengine.cs 78.31% <0%> (-0.26%) ⬇️
src/runtime/interop36.cs 100% <0%> (ø)
src/runtime/interop34.cs 100% <0%> (ø)
src/runtime/interop35.cs 100% <0%> (ø)
src/runtime/interop33.cs 100% <0%> (ø)
src/runtime/typemanager.cs 84.03% <0%> (+0.34%) ⬆️
src/runtime/moduleobject.cs 85.05% <0%> (+0.57%) ⬆️
... and 7 more

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 8629e1e...c3486f1. Read the comment docs.

@den-run-ai
Copy link
Contributor

@dmitriyse you can merge this once CI is complete

@den-run-ai
Copy link
Contributor

@dmitriyse this PR getting CI issues for anything except Python 3.6 due to API change:

https://travis-ci.org/pythonnet/pythonnet/jobs/338923690#L2119

1) Failed : Python.EmbeddingTest.TestPythonException.TestPythonErrorTypeName
  Expected string length 11 but was 19. Strings differ at index 0.
  Expected: "ImportError"
  But was:  "ModuleNotFoundError"
  -----------^
at Python.EmbeddingTest.TestPythonException.TestPythonErrorTypeName () [0x0001c] in <a5ce1c9386e541e8b3df951a1a8c18eb>:0

probably instead we need to check based on subclass, not string comparison:

issubclass(ModuleNotFoundError, ImportError)

https://docs.python.org/3/library/exceptions.html#ModuleNotFoundError

@den-run-ai den-run-ai merged commit b5d9ae8 into pythonnet:master Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0