From de4e4b4e01117cdf7c7e1021fbc43d2b9f29abd0 Mon Sep 17 00:00:00 2001 From: piair Date: Wed, 29 Dec 2021 10:54:25 +0100 Subject: [PATCH] fixed a crash occuring on logpoint --- V4.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/V4.py b/V4.py index 47bce7b..cc5b0d0 100644 --- a/V4.py +++ b/V4.py @@ -116,9 +116,11 @@ def ListTabs(Mdriver = None ): return(tabs) -def LogError(message,log = Log, Mdriver = None): - if Mdriver : - driver = Mdriver +def LogError(message,log = Log, Mobdriver = None): + if Mobdriver : + gdriver = Mobdriver + else : + gdriver = driver if not IsLinux : asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) @@ -126,10 +128,10 @@ def LogError(message,log = Log, Mdriver = None): else : with open('page.html', 'w') as f: - f.write(driver.page_source) + f.write(gdriver.page_source) - driver.save_screenshot("screenshot.png") + gdriver.save_screenshot("screenshot.png") asyncio.set_event_loop(asyncio.new_event_loop()) client = discord.Client() @@ -140,7 +142,7 @@ def LogError(message,log = Log, Mdriver = None): channel = client.get_channel(833275838837030912) #channel de log await channel.send("------------------------------------\n" + _mail) - await channel.send(ListTabs(Mdriver=Mdriver)) + await channel.send(ListTabs(Mdriver=Mobdriver)) await channel.send(str(message)) CustomSleep(1) await channel.send(file=discord.File('screenshot.png'))