Bitbot Python3.11 Inital Commit - Port to develop

This commit is contained in:
Firepup Sixfifty 2024-05-20 22:23:16 -05:00
parent af2ff08c3c
commit 59753ae05a
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA
3 changed files with 7 additions and 3 deletions

View file

@ -15,8 +15,8 @@ class Module(ModuleManager.BaseModule):
today = datetime.datetime.utcnow().date() today = datetime.datetime.utcnow().date()
week = datetime.timedelta(days=7) week = datetime.timedelta(days=7)
not_valid_until = (today-certificate.not_valid_before.date()).days not_valid_until = (today-certificate.not_valid_before_utc.date()).days
not_valid_after = (certificate.not_valid_after.date()-today).days not_valid_after = (certificate.not_valid_after_utc.date()-today).days
if not_valid_until < 0: if not_valid_until < 0:
self.log.warn( self.log.warn(

View file

@ -235,7 +235,7 @@ class ModuleManager(object):
definition.filename) definition.filename)
module = importlib.util.module_from_spec(import_spec) module = importlib.util.module_from_spec(import_spec)
sys.modules[import_name] = module sys.modules[import_name] = module
loader = typing.cast(importlib.abc.Loader, import_spec.loader) loader = typing.cast(importlib._abc.Loader, import_spec.loader)
loader.exec_module(module) loader.exec_module(module)
module_object_pointer = getattr(module, "Module", None) module_object_pointer = getattr(module, "Module", None)

View file

@ -304,7 +304,11 @@ def request_many(requests: typing.List[Request]) -> typing.Dict[str, Response]:
loop = asyncio.new_event_loop() loop = asyncio.new_event_loop()
awaits = [] awaits = []
for request in requests: for request in requests:
<<<<<<< HEAD
awaits.append(_request(request)) awaits.append(_request(request))
=======
awaits.append(loop.create_task(_request(request)))
>>>>>>> 3bf47d9d (Bitbot Python3.11 Inital Commit)
task = asyncio.wait(awaits, timeout=5) task = asyncio.wait(awaits, timeout=5)
loop.run_until_complete(task) loop.run_until_complete(task)
loop.close() loop.close()