Skip to content

Commit

Permalink
fix: move scope (#55)
Browse files Browse the repository at this point in the history
* fix: move scope

* style: apply black
  • Loading branch information
SaidBySolo committed Jul 17, 2022
1 parent 7202750 commit 0dd58a5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions neispy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def sync(
) -> SyncNeispy:
neispy = cls(KEY, Type, pIndex, pSize, only_rows=only_rows)
origin_request_func = getattr(neispy, "request")
loop = get_event_loop()

# Remove some methods
setattr(neispy, "__aenter__", None)
Expand All @@ -85,8 +86,6 @@ async def close_session_request(*args: Any, **kwargs: Any) -> Any:

def to_sync_func(func: Any):
def wrapper(*args: Any, **kwargs: Any):
loop = get_event_loop()

if loop.is_running():
return func(*args, **kwargs)

Expand Down

0 comments on commit 0dd58a5

Please sign in to comment.