Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kyan001 committed Apr 5, 2024
1 parent 97adcd5 commit 57a30ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Change Log
* 4.0.7:
* Bug Fix: Remove unsupported type hints in lower version of Python.
* 4.0.6:
* Bug Fix: Type hint and comments refines.
* 4.0.5:
Expand Down
8 changes: 4 additions & 4 deletions ping3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from . import errors
from .enums import ICMP_DEFAULT_CODE, IcmpType, IcmpTimeExceededCode, IcmpDestinationUnreachableCode

__version__ = "4.0.6"
__version__ = "4.0.7"
DEBUG = False # DEBUG: Show debug info for developers. (default False)
EXCEPTIONS = False # EXCEPTIONS: Raise exception when delay is not available.
LOGGER = None # LOGGER: Record logs into console or file. Logger object should have .debug() method.
Expand Down Expand Up @@ -177,7 +177,7 @@ def send_one_ping(sock: socket.socket, dest_addr: str, icmp_id: int, seq: int, s


@_func_logger
def receive_one_ping(sock: socket.socket, icmp_id: int, seq: int, timeout: int) -> float | None:
def receive_one_ping(sock: socket.socket, icmp_id: int, seq: int, timeout: int):
"""Receives the ping from the socket.
IP Header (bits): version (8), type of service (8), length (16), id (16), flags (16), time to live (8), protocol (8), checksum (16), source ip (32), destination ip (32).
Expand Down Expand Up @@ -257,7 +257,7 @@ def receive_one_ping(sock: socket.socket, icmp_id: int, seq: int, timeout: int)


@_func_logger
def ping(dest_addr: str, timeout: int = 4, unit: str = "s", src_addr: str = "", ttl: int | None = None, seq: int = 0, size: int = 56, interface: str = "") -> float | None | bool:
def ping(dest_addr: str, timeout: int = 4, unit: str = "s", src_addr: str = "", ttl= None, seq: int = 0, size: int = 56, interface: str = ""):
"""
Send one ping to destination address with the given timeout.
Expand Down Expand Up @@ -325,7 +325,7 @@ def ping(dest_addr: str, timeout: int = 4, unit: str = "s", src_addr: str = "",


@_func_logger
def verbose_ping(dest_addr: str, count: int = 4, interval: float = 0, *args, **kwargs) -> None:
def verbose_ping(dest_addr: str, count: int = 4, interval: float = 0, *args, **kwargs):
"""
Send pings to destination address with the given timeout and display the result.
Expand Down
2 changes: 1 addition & 1 deletion ping3/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import ping3


def main(assigned_args: list[str] = []) -> None:
def main(assigned_args: list = []) -> None:
"""
Parse and execute the call from command-line.
Expand Down

0 comments on commit 57a30ef

Please sign in to comment.