diff options
Diffstat (limited to 'src/plugins/python')
-rw-r--r-- | src/plugins/python/weechat-python-api.c | 4 | ||||
-rw-r--r-- | src/plugins/python/weechat-python.c | 2 | ||||
-rw-r--r-- | src/plugins/python/weechat.pyi | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index 5e8399959..7afddd909 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -890,7 +890,7 @@ weechat_python_api_config_read_cb (const void *pointer, void *data, func_argv[1] = (char *)API_PTR2STR(config_file); func_argv[2] = (char *)API_PTR2STR(section); func_argv[3] = (option_name) ? (char *)option_name : empty_arg; - func_argv[4] = (value) ? (char *)value : empty_arg; + func_argv[4] = (value) ? (char *)value : NULL; rc = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT, @@ -1011,7 +1011,7 @@ weechat_python_api_config_section_create_option_cb (const void *pointer, void *d func_argv[1] = (char *)API_PTR2STR(config_file); func_argv[2] = (char *)API_PTR2STR(section); func_argv[3] = (option_name) ? (char *)option_name : empty_arg; - func_argv[4] = (value) ? (char *)value : empty_arg; + func_argv[4] = (value) ? (char *)value : NULL; rc = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT, diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index bda86d2e3..49ba73610 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -446,7 +446,7 @@ weechat_python_exec (struct t_plugin_script *script, { switch (format[i]) { - case 's': /* string */ + case 's': /* string or null */ argv2[i] = argv[i]; if (weechat_utf8_is_valid (argv2[i], -1, NULL)) format2[i] = 's'; /* str */ diff --git a/src/plugins/python/weechat.pyi b/src/plugins/python/weechat.pyi index ce72b2ad4..bf4d6bc2f 100644 --- a/src/plugins/python/weechat.pyi +++ b/src/plugins/python/weechat.pyi @@ -492,7 +492,7 @@ def config_new_section(config_file: str, name: str, :: # example - def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str) -> int: + def my_section_read_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int: # ... return weechat.WEECHAT_CONFIG_OPTION_SET_OK_CHANGED # return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE @@ -507,7 +507,7 @@ def config_new_section(config_file: str, name: str, # ... return weechat.WEECHAT_CONFIG_WRITE_OK - def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str) -> int: + def my_section_create_option_cb(data: str, config_file: str, section: str, option_name: str, value: str | None) -> int: # ... return weechat.WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE |