Commit 318acbf0 authored by Alexander A. Maly's avatar Alexander A. Maly

Fixing async bug in Python 3.7

In python 3.7 async became a reserved word, so change it to async_.
Consider kicking out python from the project.
parent 2f27d046
Pipeline #696 passed with stages
in 4 minutes and 2 seconds
......@@ -56,7 +56,7 @@ and '|' is 'or'):
class Method :=
name: class Name
returnType: class BaseType | None
async: bool
async_: bool
arguments: (class Argument)*
class BaseType :=
......@@ -754,9 +754,9 @@ class Method:
else:
self.return_type = None
if "async" in json_node:
self.async = bool(json_node["async"])
self.async_ = bool(json_node["async"])
else:
self.async = self.return_type is None
self.async_ = self.return_type is None
self.arguments = []
if "arguments" in json_node:
for arg in json_node["arguments"]:
......@@ -1966,7 +1966,7 @@ private:
method_index = self._module.methods.index(method)
switch_body += "case 0x%04x: {\n" % method_index
switch_body += " /* %s */\n" % method.name.get_ascii_value()
if method.async:
if method.async_:
switch_body += " Q_EMIT asyncRun(index, args);\n"
switch_body += " return ES_Async;\n"
else:
......@@ -2057,7 +2057,7 @@ private:
for method in self._module.methods:
assert isinstance(method, Method)
method_index = self._module.methods.index(method)
if method.async:
if method.async_:
switch_body += "case 0x%04x: {\n" % method_index
switch_body += " /* %s */\n" % method.name.get_ascii_value()
args = []
......@@ -2193,7 +2193,7 @@ private:
"""
body = "module_ = new %s(this);\n" % self._module.get_module_cpp_class_name()
methods = self._module.methods
async_methods = list(filter(lambda method: method.async, methods))
async_methods = list(filter(lambda method: method.async_, methods))
if self._module.settings:
body += self._module.settings.get_settings_page_creation("settingsPage_").strip() + "\n\n"
if async_methods:
......@@ -2495,7 +2495,7 @@ class AsyncThreadCppClass(CppClassBase):
:return: implementation of void run()
"""
switch_body = ""
methods = filter(lambda module_method: module_method.async, self._module.methods)
methods = filter(lambda module_method: module_method.async_, self._module.methods)
for method in methods:
assert isinstance(method, Method)
method_index = self._module.methods.index(method)
......
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