Fix unclean exit due to uncaught errors/exceptions #5

Merged
hackrush01 merged 3 commits from fix-unclean-exit into master 2019-02-11 18:28:29 +01:00
hackrush01 commented 2019-01-30 19:34:40 +01:00 (Migrated from github.com)

This is done to prevent python spewing out "Task exception not retrieved" as asyncio.wait() doesn't consume tasks...
Also small fix, to pass unicast to _discover_gateway if set

This is done to prevent python spewing out `"Task exception not retrieved"` as `asyncio.wait()` doesn't consume tasks... Also small fix, to pass `unicast` to `_discover_gateway` if set
codecov[bot] commented 2019-01-30 19:49:21 +01:00 (Migrated from github.com)

Codecov Report

Merging #5 into master will increase coverage by 0.09%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #5      +/-   ##
==========================================
+ Coverage   82.46%   82.55%   +0.09%     
==========================================
  Files          26       26              
  Lines        1796     1811      +15     
==========================================
+ Hits         1481     1495      +14     
- Misses        315      316       +1
Impacted Files Coverage Δ
tests/test_cli.py 100% <100%> (ø) ⬆️
aioupnp/upnp.py 45.66% <100%> (ø) ⬆️
tests/test_gateway.py 97.43% <100%> (+1%) ⬆️
aioupnp/gateway.py 75.14% <77.77%> (-0.01%) ⬇️

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 19e87e8...ca5ff5f. Read the comment docs.

# [Codecov](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=h1) Report > Merging [#5](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=desc) into [master](https://codecov.io/gh/lbryio/aioupnp/commit/19e87e8cd278efd4d200bdc161c9e3fc2098d2c0?src=pr&el=desc) will **increase** coverage by `0.09%`. > The diff coverage is `90.9%`. [![Impacted file tree graph](https://codecov.io/gh/lbryio/aioupnp/pull/5/graphs/tree.svg?width=650&token=WAT2zW6Wy6&height=150&src=pr)](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #5 +/- ## ========================================== + Coverage 82.46% 82.55% +0.09% ========================================== Files 26 26 Lines 1796 1811 +15 ========================================== + Hits 1481 1495 +14 - Misses 315 316 +1 ``` | [Impacted Files](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [tests/test\_cli.py](https://codecov.io/gh/lbryio/aioupnp/pull/5/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdF9jbGkucHk=) | `100% <100%> (ø)` | :arrow_up: | | [aioupnp/upnp.py](https://codecov.io/gh/lbryio/aioupnp/pull/5/diff?src=pr&el=tree#diff-YWlvdXBucC91cG5wLnB5) | `45.66% <100%> (ø)` | :arrow_up: | | [tests/test\_gateway.py](https://codecov.io/gh/lbryio/aioupnp/pull/5/diff?src=pr&el=tree#diff-dGVzdHMvdGVzdF9nYXRld2F5LnB5) | `97.43% <100%> (+1%)` | :arrow_up: | | [aioupnp/gateway.py](https://codecov.io/gh/lbryio/aioupnp/pull/5/diff?src=pr&el=tree#diff-YWlvdXBucC9nYXRld2F5LnB5) | `75.14% <77.77%> (-0.01%)` | :arrow_down: | ------ [Continue to review full report at Codecov](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=footer). Last update [19e87e8...ca5ff5f](https://codecov.io/gh/lbryio/aioupnp/pull/5?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
jackrobison (Migrated from github.com) requested changes 2019-01-31 20:57:16 +01:00
@ -202,4 +203,4 @@
lan_address, gateway_address, timeout, igd_args, loop, unicast=True
),
cls._discover_gateway(
lan_address, gateway_address, timeout, igd_args, loop, unicast=False
jackrobison (Migrated from github.com) commented 2019-01-31 20:46:20 +01:00

What's this for?

What's this for?
@ -396,3 +396,3 @@
except UPnPError as err:
print("aioupnp encountered an error:\n%s" % str(err))
print("aioupnp encountered an error: %s" % str(err))
return
jackrobison (Migrated from github.com) commented 2019-01-31 20:56:53 +01:00

~this should be logged, not printed~

~this should be logged, not printed~
jackrobison (Migrated from github.com) reviewed 2019-02-11 15:58:31 +01:00
jackrobison (Migrated from github.com) commented 2019-02-11 15:58:31 +01:00
else:
  return task.result()
``` else: return task.result() ```
hackrush01 (Migrated from github.com) reviewed 2019-02-11 17:22:41 +01:00
hackrush01 (Migrated from github.com) commented 2019-02-11 17:22:41 +01:00

This should not be needed. The return below should always be callable

This should not be needed. The return below should always be callable
jackrobison (Migrated from github.com) approved these changes 2019-02-11 18:28:20 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/aioupnp#5
No description provided.