1
0
mirror of https://github.com/calebstewart/pwncat.git synced 2024-11-30 12:24:14 +01:00

fix for python >= 3.12

This commit is contained in:
SafaSafari 2024-08-09 19:27:46 +03:30
parent 37f04d4e16
commit e0f6c0625b
4 changed files with 9 additions and 6 deletions

View File

@ -9,6 +9,7 @@ and simply didn't have the time to go back and retroactively create one.
## [Unreleased]
### Fixed
- Fixed running on python >= 12
- Fixed `shlex.join` use with non-str type objects (e.g. `RemotePath`)
- Fixed `set` command use with incorrect keys (e.g. `set invalid value`)

View File

@ -433,8 +433,8 @@ class CommandParser:
if module_name == "base":
continue
self.commands.append(
loader.find_module(module_name)
.load_module(module_name)
loader.find_spec(module_name)
.loader.load_module(module_name)
.Command(manager)
)
@ -788,7 +788,8 @@ class CommandParser:
class CommandLexer(RegexLexer):
"""Implements a Regular Expression based pygments lexer for dynamically highlighting
the pwncat prompt during typing. The tokens are generated from command definitions."""
the pwncat prompt during typing. The tokens are generated from command definitions.
"""
tokens = {}

View File

@ -388,7 +388,8 @@ class Listener(threading.Thread):
def _ssl_wrap(self, server: socket.socket) -> ssl.SSLSocket:
"""Wrap the given server socket in an SSL context and return the new socket.
If the ``ssl`` option is not set, this method simply returns the original socket."""
If the ``ssl`` option is not set, this method simply returns the original socket.
"""
if not self.ssl:
return server
@ -934,7 +935,7 @@ class Manager:
# Why is this check *not* part of pkgutil??????? D:<
if module_name not in sys.modules:
module = loader.find_module(module_name).load_module(module_name)
module = loader.find_spec(module_name).loader.load_module(module_name)
else:
module = sys.modules[module_name]

View File

@ -520,7 +520,7 @@ class Platform(ABC):
_stat = None
def __init__(self, *args):
base_path.__init__(*args)
super().__init__(*args)
self.Path = RemotePath
""" A concrete Path object for this platform conforming to pathlib.Path """