reserve additive API slots and load optional Python modules

(cherry picked from commit 1cdee8ea6b)
This commit is contained in:
deepend authored and deepend committed 2026-11-08 06:00:01 -06:00
1 parent 5952d8f5e2
commit 2355ffc5d0
10 files changed
+86 -4

No files matched your search

+6 -1
View File
@@ -590,7 +590,12 @@ def _on_plugin_deinit():
sys.stderr = sys.__stderr__
pydoc.help = pydoc.Helper()
for mod in ('_zoitechat', 'zoitechat', 'xchat', '_zoitechat_embedded'):
# CFFI callbacks keep the embedding module's ffi/lib identity for the
# process lifetime; deleting it creates incompatible types on reload.
for mod in ('_zoitechat', 'zoitechat', 'hexchat', 'xchat',
'_zoitechat_fd', '_zoitechat_events', '_zoitechat_async',
'_zoitechat_names', '_zoitechat_contexts', '_zoitechat_post',
'_zoitechat_filters', '_zoitechat_caps'):
try:
del sys.modules[mod]