From ab7f4ca5f6185f61b36bc6932d4961f9a7179baf Mon Sep 17 00:00:00 2001 From: Yekki1 <55025184+Yekki1@users.noreply.github.com> Date: Thu, 31 Aug 2023 15:56:39 +0100 Subject: [PATCH] Update plugin.py Updated Collections Mapping to Collections.abc.Mapping to remove "Exiting: module 'collections' has no attribute 'Mapping'" error Updated Lines 714-717 for Blind execution to resolve "'bool' object has no attribute 'replace'" error --- core/plugin.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/plugin.py b/core/plugin.py index 92127fc..4d0c549 100644 --- a/core/plugin.py +++ b/core/plugin.py @@ -4,12 +4,12 @@ from utils.strings import chunkit, md5 from utils import rand from utils.loggers import log -import collections +from collections.abc import Mapping import re import itertools import base64 import datetime -import collections +import collections.abc import threading import time import utils.config @@ -18,8 +18,8 @@ def _recursive_update(d, u): # Update value of a nested dictionary of varying depth for k, v in u.items(): - if isinstance(d, collections.Mapping): - if isinstance(v, collections.Mapping): + if isinstance(d, collections.abc.Mapping): + if isinstance(v, collections.abc.Mapping): r = _recursive_update(d.get(k, {}), v) d[k] = r else: @@ -711,7 +711,11 @@ def execute(self, code, **kwargs): suffix = suffix, blind = blind ) - return result.replace('\\n', '\n') + if result: + result = result.replace('\\n', '\n') + + return result + def evaluate_blind(self, code, **kwargs):