Skip to content

Commit

Permalink
fix a type annotation error. update pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
kyan001 committed Mar 7, 2024
1 parent 5151a30 commit f5566dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 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.4"
__version__ = "4.0.5"
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.
Expand Down Expand Up @@ -140,7 +140,7 @@ def stringify_ip(ip: int) -> str:


@_func_logger
def send_one_ping(sock: socket, dest_addr: str, icmp_id: int, seq: int, size: int):
def send_one_ping(sock: socket.socket, dest_addr: str, icmp_id: int, seq: int, size: int):
"""Sends one ping to the given destination.
ICMP Header (bits): type (8), code (8), checksum (16), id (16), sequence (16)
Expand Down Expand Up @@ -177,7 +177,7 @@ def send_one_ping(sock: socket, dest_addr: str, icmp_id: int, seq: int, size: in


@_func_logger
def receive_one_ping(sock: socket, icmp_id: int, seq: int, timeout: int) -> float:
def receive_one_ping(sock: socket.socket, icmp_id: int, seq: int, timeout: int) -> float:
"""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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "ping3"
description = "A pure python3 version of ICMP ping implementation using raw socket."
requires-python = ">=3"
requires-python = ">=3.5"
readme = "README.md"
keywords = ["python3", "ping", "icmp", "socket", "tool"]
license = {file = "LICENSE"}
Expand Down

0 comments on commit f5566dc

Please sign in to comment.