summary refs log tree commit diff stats
path: root/plugins/python
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/python')
-rw-r--r--plugins/python/python.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/python/python.py b/plugins/python/python.py
index 1adcde98..7a794784 100644
--- a/plugins/python/python.py
+++ b/plugins/python/python.py
@@ -146,8 +146,8 @@ class Plugin:
     def loadfile(self, filename):
         try:
             self.filename = filename
-            with open(filename, encoding='utf-8') as f:
-                data = f.read()
+            with open(filename, 'rb') as f:
+                data = f.read().decode('utf-8')
             compiled = compile_file(data, filename)
             exec(compiled, self.globals)
 
@@ -284,7 +284,7 @@ def _on_server_attrs_hook(word, word_eol, attrs, userdata):
 @ffi.def_extern()
 def _on_timer_hook(userdata):
     hook = ffi.from_handle(userdata)
-    if hook.callback(hook.userdata) is True:
+    if hook.callback(hook.userdata) == True:
         return 1
 
     hook.is_unload = True  # Don't unhook