From e3e8c02174be8605e5c130365220f3bed169a562 Mon Sep 17 00:00:00 2001 From: tema Date: Sun, 9 Oct 2022 15:24:23 +0300 Subject: [PATCH] Try fix restart loop --- utils/misc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/misc.py b/utils/misc.py index 56f7df9..c625309 100644 --- a/utils/misc.py +++ b/utils/misc.py @@ -19,4 +19,6 @@ class Update: @staticmethod def restart_bot(): - os.execvp(sys.executable, [sys.executable, sys.argv[0]]) \ No newline at end of file + if sys.argv[1] == 'restart': + return + os.execvp(sys.executable, [sys.executable, sys.argv[0], 'restart']) \ No newline at end of file