From 3ebfa83fdd43335da1dd2d39f0bfae91d67b8c90 Mon Sep 17 00:00:00 2001
From: A_D <A_D@snoonet.org>
Date: Wed, 26 Dec 2018 20:37:56 +0200
Subject: python: Made sure to set sys.argv if it is not set. fixes #2282

---
 plugins/python/python.py | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'plugins')

diff --git a/plugins/python/python.py b/plugins/python/python.py
index 1eeb10b4..942b0ce5 100644
--- a/plugins/python/python.py
+++ b/plugins/python/python.py
@@ -10,6 +10,9 @@ import traceback
 import weakref
 from _hexchat_embedded import ffi, lib
 
+if not hasattr(sys, 'argv'):
+    sys.argv = ['<hexchat>']
+
 VERSION = b'2.0'  # Sync with hexchat.__version__
 PLUGIN_NAME = ffi.new('char[]', b'Python')
 PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface'
-- 
cgit 1.4.1