python: Various cffi fixes

- fixed /py exec behaviour
- fixed hexchat.unload_hook() failing when passed a hook id
- fixed get_list() calls in python3
This commit is contained in:
A_D
2018-07-25 21:41:05 +02:00
committed by Patrick Griffis
parent 706f9bca82
commit a2ff661d40
2 changed files with 13 additions and 3 deletions

View File

@@ -98,7 +98,8 @@ else:
return compile(data, filename, 'exec', optimize=2, dont_inherit=True)
def compile_line(string):
return compile(string, '<string>', 'eval', optimize=2, dont_inherit=True)
# newline appended to solve unexpected EOF issues
return compile(string + '\n', '<string>', 'single', optimize=2, dont_inherit=True)
class Plugin:
@@ -122,7 +123,7 @@ class Plugin:
def remove_hook(self, hook):
for h in self.hooks:
if id(h) == hook:
ud = hook.userdata
ud = h.userdata
self.hooks.remove(h)
return ud
else: