Fix #1928, @concurrent decorator now works for class methods.

This commit is contained in:
Matthew Shao 2017-02-21 11:59:50 +08:00
parent 18401dda8f
commit f9714fbf3e

View File

@ -29,4 +29,7 @@ def concurrent(fn):
"script.concurrent (%s)" % fn.__name__, "script.concurrent (%s)" % fn.__name__,
target=run target=run
).start() ).start()
return _concurrent if "." in fn.__qualname__:
return staticmethod(_concurrent)
else:
return _concurrent