removed the sync_only decorator

This commit is contained in:
nocturn9x 2020-03-20 10:27:12 +01:00
parent f7fadabc5e
commit 94092a7ae7
1 changed files with 0 additions and 13 deletions

View File

@ -8,17 +8,6 @@ import socket
from .exceptions import GiambioError, AlreadyJoinedError
import traceback
return_values = {} # Saves the return values from coroutines
exceptions = {} # Saves exceptions from errored coroutines
def sync_only(func):
@wraps(func)
def wrapper(*args, **kwargs):
if iscoroutine(2):
raise RuntimeError(f"Function '{func.__name__}' MUST be called from a synchronous context!")
return func(*args, **kwargs)
return wrapper
class Task:
@ -54,7 +43,6 @@ class EventLoop:
self.running = None # This will always point to the currently running coroutine (Task object)
self.waitlist = defaultdict(list) # Tasks that want to join
@sync_only
def loop(self):
"""Main event loop for giambio"""
@ -88,7 +76,6 @@ class EventLoop:
self.to_run.append(task)
return task
@sync_only
def start(self, coroutine: types.coroutine, *args, **kwargs):
self.spawn(coroutine(*args, **kwargs))
self.loop()