* Ultroid 2025 Co-authored-by: New-dev0 <New-dev0@users.noreply.github.com> Co-authored-by: Amit Sharma <buddhhu@users.noreply.github.com> Co-authored-by: TechiError <techierror@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com>
29 lines
835 B
Python
29 lines
835 B
Python
# Ultroid - UserBot
|
|
# Copyright (C) 2021-2025 TeamUltroid
|
|
#
|
|
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
|
# PLease read the GNU Affero General Public License in
|
|
# <https://github.com/TeamUltroid/pyUltroid/blob/main/LICENSE>.
|
|
|
|
# https://bugs.python.org/issue26789
|
|
# 'open' not defined has been fixed in Python3.10
|
|
# for other older versions, something need to be done.
|
|
|
|
|
|
def _fix_logging(handler):
|
|
handler._builtin_open = open
|
|
|
|
def _new_open(self):
|
|
open_func = self._builtin_open
|
|
return open_func(self.baseFilename, self.mode)
|
|
|
|
setattr(handler, "_open", _new_open)
|
|
|
|
|
|
def _ask_input():
|
|
# Ask for Input even on Vps and other platforms.
|
|
def new_input(*args, **kwargs):
|
|
raise EOFError("args=" + str(args) + ", kwargs=" + str(kwargs))
|
|
|
|
__builtins__["input"] = new_input
|