Skip to content

Drop Python 2 support from python-nmap #7706

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 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions stubs/python-nmap/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
version = "0.6.*"
python2 = true
requires = []
21 changes: 11 additions & 10 deletions stubs/python-nmap/nmap/nmap.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, Callable, Iterable, Iterator, Text, TypeVar
from collections.abc import Callable, Iterable, Iterator
from typing import Any, TypeVar
from typing_extensions import TypeAlias, TypedDict

_T = TypeVar("_T")
Expand Down Expand Up @@ -49,13 +50,13 @@ class _ResultHostPort(TypedDict):

__last_modification__: str

class PortScanner(object):
class PortScanner:
def __init__(self, nmap_search_path: Iterable[str] = ...) -> None: ...
def get_nmap_last_output(self) -> Text: ...
def get_nmap_last_output(self) -> str: ...
def nmap_version(self) -> tuple[int, int]: ...
def listscan(self, hosts: str = ...) -> list[str]: ...
def scan(
self, hosts: Text = ..., ports: Text | None = ..., arguments: Text = ..., sudo: bool = ..., timeout: int = ...
self, hosts: str = ..., ports: str | None = ..., arguments: str = ..., sudo: bool = ..., timeout: int = ...
) -> _Result: ...
def analyse_nmap_xml_scan(
self,
Expand All @@ -64,7 +65,7 @@ class PortScanner(object):
nmap_err_keep_trace: str = ...,
nmap_warn_keep_trace: str = ...,
) -> _Result: ...
def __getitem__(self, host: Text) -> PortScannerHostDict: ...
def __getitem__(self, host: str) -> PortScannerHostDict: ...
def all_hosts(self) -> list[str]: ...
def command_line(self) -> str: ...
def scaninfo(self) -> _ResultNmapInfo: ...
Expand All @@ -73,17 +74,17 @@ class PortScanner(object):
def csv(self) -> str: ...

def __scan_progressive__(
self: object, hosts: Text, ports: Text, arguments: Text, callback: _Callback | None, sudo: bool, timeout: int
self: object, hosts: str, ports: str, arguments: str, callback: _Callback | None, sudo: bool, timeout: int
) -> None: ...

class PortScannerAsync(object):
class PortScannerAsync:
def __init__(self) -> None: ...
def __del__(self) -> None: ...
def scan(
self,
hosts: Text = ...,
ports: Text | None = ...,
arguments: Text = ...,
hosts: str = ...,
ports: str | None = ...,
arguments: str = ...,
callback: _Callback | None = ...,
sudo: bool = ...,
timeout: int = ...,
Expand Down