Skip to content

Commit d0990a0

Browse files
authored
Drop Python 2 support from python-nmap (#7706)
1 parent 2fb8424 commit d0990a0

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

stubs/python-nmap/METADATA.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
version = "0.6.*"
2-
python2 = true
3-
requires = []

stubs/python-nmap/nmap/nmap.pyi

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Any, Callable, Iterable, Iterator, Text, TypeVar
1+
from collections.abc import Callable, Iterable, Iterator
2+
from typing import Any, TypeVar
23
from typing_extensions import TypeAlias, TypedDict
34

45
_T = TypeVar("_T")
@@ -49,13 +50,13 @@ class _ResultHostPort(TypedDict):
4950

5051
__last_modification__: str
5152

52-
class PortScanner(object):
53+
class PortScanner:
5354
def __init__(self, nmap_search_path: Iterable[str] = ...) -> None: ...
54-
def get_nmap_last_output(self) -> Text: ...
55+
def get_nmap_last_output(self) -> str: ...
5556
def nmap_version(self) -> tuple[int, int]: ...
5657
def listscan(self, hosts: str = ...) -> list[str]: ...
5758
def scan(
58-
self, hosts: Text = ..., ports: Text | None = ..., arguments: Text = ..., sudo: bool = ..., timeout: int = ...
59+
self, hosts: str = ..., ports: str | None = ..., arguments: str = ..., sudo: bool = ..., timeout: int = ...
5960
) -> _Result: ...
6061
def analyse_nmap_xml_scan(
6162
self,
@@ -64,7 +65,7 @@ class PortScanner(object):
6465
nmap_err_keep_trace: str = ...,
6566
nmap_warn_keep_trace: str = ...,
6667
) -> _Result: ...
67-
def __getitem__(self, host: Text) -> PortScannerHostDict: ...
68+
def __getitem__(self, host: str) -> PortScannerHostDict: ...
6869
def all_hosts(self) -> list[str]: ...
6970
def command_line(self) -> str: ...
7071
def scaninfo(self) -> _ResultNmapInfo: ...
@@ -73,17 +74,17 @@ class PortScanner(object):
7374
def csv(self) -> str: ...
7475

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

79-
class PortScannerAsync(object):
80+
class PortScannerAsync:
8081
def __init__(self) -> None: ...
8182
def __del__(self) -> None: ...
8283
def scan(
8384
self,
84-
hosts: Text = ...,
85-
ports: Text | None = ...,
86-
arguments: Text = ...,
85+
hosts: str = ...,
86+
ports: str | None = ...,
87+
arguments: str = ...,
8788
callback: _Callback | None = ...,
8889
sudo: bool = ...,
8990
timeout: int = ...,

0 commit comments

Comments
 (0)