Commit e1d32d76 authored by Simon McVittie's avatar Simon McVittie Committed by Christian Hergert

Python: Avoid identifier 'async', which became a keyword in 3.7

This is an incompatible change, but so is async becoming an identifier.

Fixes: #565
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903558Signed-off-by: 's avatarSimon McVittie <smcv@debian.org>
parent 28863739
...@@ -41,9 +41,9 @@ class _Gio_DBusMethodInfo: ...@@ -41,9 +41,9 @@ class _Gio_DBusMethodInfo:
in_args = None in_args = None
out_signature = None out_signature = None
def DBusMethod(dbus_interface, in_signature=None, out_signature=None, async=False): def DBusMethod(dbus_interface, in_signature=None, out_signature=None, is_async=False):
def decorator(func): def decorator(func):
func._is_async = async func._is_async = is_async
func._dbus_method = _Gio_DBusMethodInfo() func._dbus_method = _Gio_DBusMethodInfo()
func._dbus_method.interface = dbus_interface func._dbus_method.interface = dbus_interface
...@@ -54,7 +54,7 @@ def DBusMethod(dbus_interface, in_signature=None, out_signature=None, async=Fals ...@@ -54,7 +54,7 @@ def DBusMethod(dbus_interface, in_signature=None, out_signature=None, async=Fals
in_signature_list = GLib.Variant.split_signature('('+in_signature+')') in_signature_list = GLib.Variant.split_signature('('+in_signature+')')
arg_names = inspect.getargspec(func).args arg_names = inspect.getargspec(func).args
arg_names.pop(0) # eat "self" argument arg_names.pop(0) # eat "self" argument
if async: arg_names.pop(0) # eat "invocation" if is_async: arg_names.pop(0) # eat "invocation"
if len(in_signature) != len(arg_names): if len(in_signature) != len(arg_names):
raise TypeError('specified signature %s for method %s does not match length of arguments' % (str(in_signature_list), func.func_name)) raise TypeError('specified signature %s for method %s does not match length of arguments' % (str(in_signature_list), func.func_name))
for pair in zip(in_signature_list, arg_names): for pair in zip(in_signature_list, arg_names):
......
...@@ -688,7 +688,7 @@ class JediService(Ide.DBusService): ...@@ -688,7 +688,7 @@ class JediService(Ide.DBusService):
self.queue = {} self.queue = {}
self.handler_id = 0 self.handler_id = 0
@Ide.DBusMethod('org.gnome.builder.plugins.jedi', in_signature='siis', out_signature='a(issass)', async=True) @Ide.DBusMethod('org.gnome.builder.plugins.jedi', in_signature='siis', out_signature='a(issass)', is_async=True)
def CodeComplete(self, invocation, filename, line, column, content): def CodeComplete(self, invocation, filename, line, column, content):
if filename in self.queue: if filename in self.queue:
request = self.queue.pop(filename) request = self.queue.pop(filename)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment