Skip to content

Commit

Permalink
fix: replace append with extend for more than 1 gateways
Browse files Browse the repository at this point in the history
traceback:
```
---
File "smart_sleep.py", line 644, in check_connected_to_internetV3
    to_check.append(*gateways[netifaces.AF_INET])
TypeError: append() takes exactly one argument (2 given)
```
  • Loading branch information
RoguedBear committed Dec 17, 2021
1 parent 838bf9e commit 6ae75d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion smart_sleep.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def ping(ip: str) -> bool:
) # AF_INET is ipv4 addresses
elif connection_type in ["wired", "wireless"]:
if netifaces.AF_INET in gateways:
to_check.append(*gateways[netifaces.AF_INET])
to_check.extend(gateways[netifaces.AF_INET])
else:
raise ValueError(
f'parameter connection_type expected one of wired/wireless/any, got: "{connection_type}"'
Expand Down

0 comments on commit 6ae75d7

Please sign in to comment.